"Ubilogin-Server Fails to Start Due to Missing Parameter JAVA_HOME or JRE_HOME" Error After Manual Java Installation
Â
Last reviewed:Â 2024-02-20
PLEASE NOTE!
Please note that this Knowledge Base article has been created only for 2023.2
Please note that the information in this Knowledge Base has not undergone extensive testing or verification by our Engineering team. While this article offers valuable insights, it may not guarantee flawless solutions for your specific Identity Server environment and configuration.
Please contact your Ubisecure partner and/or Ubisecure Support team to obtain more information.
Problem Description:
When attempting to start the server, users may encounter an error message indicating that the server failed to start due to missing parameters such as JAVA_HOME or JRE_HOME. This error often occurs after manually installing Java without setting up the necessary environment variables.Â
Solution:
To resolve this issue and enable the server to start successfully, follow these steps:Â
Locate the Java Installation Directory:
Begin by identifying the directory where Java is installed on your system. This could be a directory like /usr/local/java, /opt/java, or any other location where Java was manually installed.Â
Check the Symbolic LinkÂ
The most plausible cause of this error when installing Java without the help package manager is that the Symbolic Link is missing (Setting symbolic link could be avoided by configuring all the environment variables with the full path to java, but this is the preferred method in Unix). You can manually check whether the symbolic link to java exists in the expected location (e.g., /usr/bin/java). You can do this by navigating to the directory where the symbolic link should be located and checking if it's there:
Unix:
ls -l /usr/bin/java
If the symbolic link does not exist, it confirms that it's missing and you can continue with creating the symbolic link:
Identify the Java executable: Inside the Java installation directory, there should be a bin directory containing executables like java, javac, etc. Find the path to the java executable.
Create the symbolic link: Once you've identified the path to the java executable, you can create a symbolic link in /usr/bin to it. Open a terminal and run the following command, replacing /path/to/java/bin/java with the actual path you found in step 1:
Unix:sudo ln -s /path/to/java/bin/java /usr/bin/java
Verify the installation: After creating the symbolic link, you can verify that Java is correctly linked by running:
java -version
This should display the installed Java version. If you see the version information, then Java is correctly linked.
Â
By creating this symbolic link, you'll be able to use Java commands from anywhere in your terminal session, as /usr/bin is typically in the system's PATH.
Set JAVA_HOME or JRE_HOME Environment Variable:
Unix:
Replace /path/to/java or /path/to/jre with the actual path to your Java installation directory.
Windows:
In Search, search for and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables find the
JAVA_HOME and JRE_HOME
environment variables and select it. Click Edit. If they do not exist, clickNew
.In the Edit System Variable (or New System Variable) window, specify the values of the environment variables JAVA_HOME=
C:\path\to\java
JRE_HOME=C:\path\to\jre
and add %JAVA_HOME%\bin to Path variable. Click OK. Close all remaining windows by clicking OK.Reopen Command prompt window, and run your java code.
Update System Configuration (Optional):
Optionally, you may need to update system configuration files to ensure the environment variables are set globally. This step is particularly necessary if the server is started as a service or by a different user.
Verify Environment Variable Setup:
Verify that the JAVA_HOME or JRE_HOME environment variable is set correctly by running the following commands:
Unix:
Windows:
If these commands return $JAVA_HOME and $JRE_HOME respectively instead of the path, something has gone wrong
Restart the Server:
Once you have set up the environment variables correctly, attempt to restart the server. The server should now start without encountering the previous errors related to missing parameters.
Â
Conclusion:
By following the steps outlined in this guide, you should be able to resolve the issue of servers failing to start due to missing JAVA_HOME or JRE_HOME parameters after manually installing Java. Properly configuring these environment variables ensures that the server can locate the Java installation and start without errors.