• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

can two jdk versions coexist?

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can I have two different versions of Java live on the same box and depending on the path settings for a user, use one over the other?
Because I don't see any common files, has anyone tried doing it. The Sun download site clearly says "Uninstall the previous version before installing the new version"
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi - For Linux, absolutely yes, I do it all the time.
User 1:
export JAVA_HOME=/opt/jdk1.3.1
export PATH=$JAVA_HOME/bin:$PATH
User 2:
export JAVA_HOME=/opt/jdk1.4.0
export PATH=$JAVA_HOME/bin:$PATH
You can even flip/flop on the fly, or have the same user using different JDKs on different terminals.
Regards, Guy
[ November 26, 2002: Message edited by: Guy Allard ]
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, this is definitely possible.
Usually, I use symbolic links rather than having to change my environment settings
i.e. ln -s /usr/java/jdk1.3.1_03 jdk
So my PATH/JDK_HOME/JAVA_HOME is always ~/jdk, and I just change the symlink whenever I need to switch from 1.3.1 and 1.4.0 or whatever
I also do this on any winnt style platforms using the rather good "junction" command available from the always useful www.sysinternals.com
 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May One user have two jdk installations and use them alternately as wish?
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure. Set up two environment variables, each of which points to an installation. Then use JAVA_HOME or similar variables to point to them as desired. Ex:
JDK14=/usr/java1.4
JDK13=/usr/java1.3
JAVA_HOME=${JDK14}
PATH=${JAVA_HOME}/bin:${PATH}
If you want to get really fancy, you could write each setup to a separate file and use the source command of your favorite interpreter to make changes.
reply
    Bookmark Topic Watch Topic
  • New Topic