cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Occasional contributor

Finding java exe from the flexnetls.bat file

Hello,

I got an issue setting up a self hosted FNE license server as a service and that got me looking in the flexnetls.bat file. The extract below got me confused.

for %%X in (java.exe) do (set FOUND=%%~$PATH:X)
if not defined FOUND (
	echo Error: Java executable not found in path, please check you system path variable.
	GOTO :eof
)
IF NOT %JAVA_HOME% == "" (
	SET JAVA_TO_USE=%JAVA_HOME%
	GOTO :foundJava
)

IF NOT %JRE_HOME% == "" (
	SET JAVA_TO_USE=%JRE_HOME%
	GOTO :foundJava
)

ECHO Error: JAVA_HOME or JRE_HOME must be defined
GOTO :eof

The error I got installing the server as a service is 

Error: Java executable not found in path, please check you system path variable.

Among the parameters to configure for the server is to specify a JAVA_HOME or JRE_HOME environment variable which points to a jdk/jre installation. In my case, I didnt actually install Java but instead copied a JDK 1.8 folder from another machine pointed my JAVA_HOME to this folder.

So my questions are as follows:

1. if I have to define a JAVA_HOME or JRE_HOME environment variable, should the extracted code above from the flexnetls.bat file, looking for the java.exe application, not look for java.exe in the JAVA_HOME/JRE_HOME location?

2. if, like I said, I don't install Java but just point my JAVA_HOME/JRE_HOME environment variable to a non-installed JDK/JRE folder, is there then an extra step to add the JAVA_HOME/JRE_HOME variable to the PATH environment vairiable?

Thanks.

0 Kudos
2 Replies
Highlighted
Moderator Moderator
Moderator

Re: Finding java exe from the flexnetls.bat file

Hi @ageorge ,

 

1. Yes, the flexnetls.bat script will look for the system environment variable setting for JAVA_HOME.

 

2. Yes, the License Server Guide documents the prerequisite highlighted in embedded screen grab.

ejohnson1_0-1583419577456.png

 

0 Kudos
Highlighted
Occasional contributor

Re: Finding java exe from the flexnetls.bat file

Hi @ejohnson1 ,

I'm not sure I follow your answers.

For #1, my point (or question) is why is the script NOT looking for the Java.exe application in the JAVA_HOME/JRE_HOME location?

For #2, the guide document says to set the JAVA_HOME or JRE_HOME system environment variable. It does not say whether that system environment variable should also be added to the PATH system environment variable.

 

From what I have gathered, it looks like the PATH environment variable should be able to locate java.exe so I will update my internal documentation accordingly.

 

Thanks.

0 Kudos