• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using sun jdk

 
Atul Darne
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]#
 
Atul Darne
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Atul Darne
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i updated an entry in .bashrc script by editing
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic