aspose file tools*
The moose likes Linux / UNIX and the fly likes using sun jdk Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "using sun jdk" Watch "using sun jdk" New topic
Author

using sun jdk

Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

Hi,

i have a linux machine which has a Open JDK installed.

i downloaded a sun jdk and installed, it, now i want the system to use the sun jdk how do i configure it ??

i have the following

[root@localhost opt]# find / -name java
/usr/share/swig/1.3.40/java
/usr/share/mysql-gui/common/java
/usr/share/javadoc/java-1.6.0-openjdk/api/org/omg/stub/java
/usr/share/javadoc/java-1.6.0-openjdk/api/java
/usr/share/javadoc/java-1.6.0-openjdk/jre/api/plugin/dom/com/sun/java
/usr/share/javadoc/java
/usr/share/java
/usr/share/doc/db4-devel-4.7.25/java
/usr/share/doc/db4-devel-4.7.25/ref/java
/usr/bin/java
/usr/java
/usr/java/jdk1.6.0_25/bin/java
/usr/java/jdk1.6.0_25/jre/bin/java
/usr/lib/jvm-exports/java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/bin/java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java
/usr/lib/jvm/java
/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre/bin/java
/usr/lib/java
/opt/sun/javadb/demo/programs/scores/java
/opt/sun/javadb/demo/programs/vtis/java
/var/lib/alternatives/java
/etc/alternatives/java
/etc/pki/java
/etc/java
[root@localhost opt]# clear
[root@localhost opt]# find / -name java
/usr/share/swig/1.3.40/java
/usr/share/mysql-gui/common/java
/usr/share/javadoc/java-1.6.0-openjdk/api/org/omg/stub/java
/usr/share/javadoc/java-1.6.0-openjdk/api/java
/usr/share/javadoc/java-1.6.0-openjdk/jre/api/plugin/dom/com/sun/java
/usr/share/javadoc/java
/usr/share/java
/usr/share/doc/db4-devel-4.7.25/java
/usr/share/doc/db4-devel-4.7.25/ref/java
/usr/bin/java
/usr/java
/usr/java/jdk1.6.0_25/bin/java
/usr/java/jdk1.6.0_25/jre/bin/java
/usr/lib/jvm-exports/java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/bin/java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java
/usr/lib/jvm/java
/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre/bin/java
/usr/lib/java
/opt/sun/javadb/demo/programs/scores/java
/opt/sun/javadb/demo/programs/vtis/java
/var/lib/alternatives/java
/etc/alternatives/java
/etc/pki/java
/etc/java
[root@localhost opt]#

Regards, Atul.
I came to this world on a Learner's License
Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

i set the path by

export PATH=/usr/java/jdk1.6.0_25/bin:$PATH

i need to configure this startup

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

Java is not like Internet Explorer where there can be only one version for the entire OS. You can have multiple JDKs and/or JREs installed at once and pick which one to use on a per-application basis (although not a per-webapp basis, since web application servers are counted by the OS as a single Java app).

Therefore, assigning a JDE or JRE to the PATH depends on the shell instance.

I don't assign Java's PATH on a global basis, since apps such as Tomcat don't need Java in the path - the Tomcat control script simply uses the JAVA_HOME environment setting that was in effect when Tomcat was launched.

My development user account, however, does set (export) JAVA_HOME and adds $JAVA_HOME/bin to my PATH when I login or spawn a new shell process. I assign it in my .bashrc script, which isn't really the best place to put it out of the 8 or so possibilities, but it suffices for me.


Customer surveys are for companies who didn't pay proper attention to begin with.
Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

thanks i updated an entry in .bashrc script by editing
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using sun jdk