This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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
Author

how to setup JAVA_HOME and JAVA_PATH

cake naiyou
Greenhorn

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
Bartender

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!
john
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

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 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to setup JAVA_HOME and JAVA_PATH