*
The moose likes Java in General and the fly likes Environment Variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Environment Variable" Watch "Environment Variable" New topic
Author

Environment Variable

jignesh soni
Ranch Hand

Joined: Dec 10, 2007
Posts: 150
I am working on a server.
How do I check that jre is set in PATH or CLASSPATH variable ?
Can jre be set in JAVA_HOME variable or any other variable ?

thanks
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
JAVA_HOME may be used as part of PATH.
The JRE might be in something like /usr/bin, as a .so file, otherwise it ought to be in PATH.
You might not have anything in CLASSPATH. Try echo (on Bash)
[Campbell@queeg ~]$ echo $PATH
/usr/java/jdk1.6.0_11/bin/:/usr/java/jdk1.6.0_11/bin/:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/Campbell/bin
[Campbell@queeg ~]$ echo $CLASSPATH

[Campbell@queeg ~]$ echo $JAVA_HOME

[Campbell@queeg ~]$
Note I have nothing set as JAVA_HOME or CLASSPATH. I think on Windows you write PATH at a command line.

Is that any help to you?
[ December 15, 2008: Message edited by: Campbell Ritchie ]
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
In windows as well, try typing the classpath in the command prompt:

In the Tomcat servlet container, the console explicitly logs in the environment variables included in the java library path logged at INFO level during the startup.
ramya narayanan
Ranch Hand

Joined: Oct 06, 2008
Posts: 338
Does it mean that when we're starting the tomcat service the environment variables path and classpath will be displayed at the [INFO] tags.
Regards.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8803
    
    5
off to the intermediate forum...


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
Originally posted by ramya narayanan:
Does it mean that when we're starting the tomcat service the environment variables path and classpath will be displayed at the [INFO] tags.
Regards.


Its necessarily the INFO message for Tomcat Native library (tcnative-1.dll) which is optional. The list of libraries added to your PATH are displayed right ahead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Environment Variable
 
Similar Threads
'java' is not recognized as an internal or external command, operable program or batch file.
IS 1.6 JRE Required
UnsupportedClassVersionError
can not run tomcat 5.5.9 with only jre
JAVA_HOME does not point to the JDK