Question re JAVA_HOME and JDK_HOME

This forum is for anything about Rel that isn't more appropriate elsewhere.
Post Reply
HughDarwen
Posts: 124
Joined: Sat May 24, 2008 4:49 pm

Question re JAVA_HOME and JDK_HOME

Post by HughDarwen »

When I execute OperatorsChar.d, for example, the DBrowser monitor gives me repetitions of this message:

NOTE: A 'tools.jar' or internal Java compiler can't be found.
Make sure JAVA_HOME or JDK_HOME point to a JDK installation.
Trying to find an external javac compiler as an alternative.

It's only a warning. Everything works fine, but with OperatorsNum.d, for example, it can take an age and I'm wondering if it's the "trying to find" bit that slows things down.

My environment variables do not include anything for JAVA_HOME or JDK_HOME, in either the user section or the system section. The installation instructions mention the need for JDK but are silent on environment variables apart from the mention of PATH.

My PATH variable includes an entry for C:\Program Files\Java\jdk1.6.0_06\bin. I found a tools.jar in C:\Program Files\Java\jdk1.6.0_06\lib, so I set JDK_HOME to C:\Program Files\Java\jdk1.6.0_06. That stopped the above message from appearing but then I got this instead, just once:

ERROR: Java error: warning: java\lang\Object.class(java\lang:Object.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.:  in line -1 of: d:\Alldocs\All Rel Databases\test\Database\RelUserCode\op_IS_DIGITS__CHARACTER.java Java error: warning: java\lang\String.class(java\lang:String.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded.:  in line -1 of: d:\Alldocs\All Rel Databases\test\Database\RelUserCode\op_IS_DIGITS__CHARACTER.java Java error: warning: java\lang\Character.class(java\lang:Character.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded.:  in line -1 of: d:\Alldocs\All Rel Databases\test\Database\RelUserCode\op_IS_DIGITS__CHARACTER.java Line 3      In IS_DIGITS(CHARACTER) RETURNS BOOLEAN line 1

I do also have a Java installation in C:\Program Files\Java\jre7 but this is not JDK and there's no reference to this folder in my environment variables. Its last modified date is today, and I did get one of those annoyingly frequent Java updates from Oracle today.

Is there any action I can take to avoid this new message? Should the installation instructions give any advice on this matter?

Hugh
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: Question re JAVA_HOME and JDK_HOME

Post by Dave »

HughDarwen wrote:When I execute OperatorsChar.d, for example, the DBrowser monitor gives me repetitions of this message:

NOTE: A 'tools.jar' or internal Java compiler can't be found.
Make sure JAVA_HOME or JDK_HOME point to a JDK installation.
Trying to find an external javac compiler as an alternative.

It's only a warning. Everything works fine, but with OperatorsNum.d, for example, it can take an age and I'm wondering if it's the "trying to find" bit that slows things down.
The "trying to find" probably has less speed impact than the fact that it's not found. If Rel can't find 'tools.jar' -- a Java library that contains a Java compiler, which is normally part of a Java Development Kit or JDK -- it will use a command-line javac compiler (also part of a Java Development Kit). The latter is considerably slower than the former, though how much slower is dependent on the speed of your computer.
HughDarwen wrote:My environment variables do not include anything for JAVA_HOME or JDK_HOME, in either the user section or the system section. The installation instructions mention the need for JDK but are silent on environment variables apart from the mention of PATH.

My PATH variable includes an entry for C:\Program Files\Java\jdk1.6.0_06\bin. I found a tools.jar in C:\Program Files\Java\jdk1.6.0_06\lib, so I set JDK_HOME to C:\Program Files\Java\jdk1.6.0_06. That stopped the above message from appearing but then I got this instead, just once:

ERROR: Java error: warning: java\lang\Object.class(java\lang:Object.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.:  in line -1 of: d:\Alldocs\All Rel Databases\test\Database\RelUserCode\op_IS_DIGITS__CHARACTER.java
The above means the version of the JDK that JDK_HOME points to doesn't match the version of Java that is running Rel. This typically results from updating Java when prompted by Oracle -- which is a good idea -- but as it only updates the Java run-time (also known as the JRE), the JDK version winds up being different.
HughDarwen wrote:Is there any action I can take to avoid this new message?
Yes. Install the latest JDK and point JDK_HOME at it.
HughDarwen wrote:Should the installation instructions give any advice on this matter?
Good point -- they should. I'll write up something on this when I get a moment.
HughDarwen
Posts: 124
Joined: Sat May 24, 2008 4:49 pm

Re: Question re JAVA_HOME and JDK_HOME

Post by HughDarwen »

Many thanks for the clear advice, which worked fine and OperatorsChar.d was executed in a flash. I installed JDK V7.0.7 in a new directory and noticed that its bin subdirectory contains both java.exe and javac.eex. I placed this bin subdirectory in my PATH variable, replacing the previous entry for Java. I also set environment variable JDK_HOME to this directory. I have not set JAVA_HOME to anything as I assume the PATH entry is sufficient.

I have registered myself with Oracle as a JDK user in the hope that future Java updates will apply to this JDK installation.

Hugh
Post Reply