wood burning stoves 2.0
The moose likes Beginning Java and the fly likes how to setup JAVA_HOME and JAVA_PATH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to setup JAVA_HOME and JAVA_PATH" Watch "how to setup JAVA_HOME and JAVA_PATH" New topic

how to setup JAVA_HOME and JAVA_PATH

cake naiyou

Joined: Apr 29, 2011
Posts: 27
I opened the .bashrc file of an established system, which includes

After typing
, the system prints out

It seems to me that none of the above path matches the JAVA_HOME set up in bashrc file. Can you let me know why? I am pretty confusing about how to setting up JAVA_HOME and JAVA_PATH
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

The environment variable JAVA_HOME has no special meaning to Java. Some Java applications such as Tomcat use it but Java in general does not. If your JAVA_HOME points to a non-existent directory then it can probably be safely removed.

Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
John Jai

Joined: May 31, 2011
Posts: 1776
cake naiyou wrote:

Sorry I have few experience in setting Java @ Unix server. Might not be true but it seems like whereis also prints the soft links pointing to real installation of java. Usually the /usr/bin/java where the one we used in the past to compile.

Others should help you!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

On Unix-like operating systems, you can have symbolic links. For example, /usr/bin/java might be a link to a file in a completely different directory (maybe somewhere in the directory /usr/lib/jvm/java-1.6.0-sun.x86.64). You can't see that just by looking at the name /usr/bin/java alone.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link: http://aspose.com/file-tools
subject: how to setup JAVA_HOME and JAVA_PATH
It's not a secret anymore!