GeeCON Prague 2014*
The moose likes Java in General and the fly likes Two JDK on a machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Two JDK on a machine" Watch "Two JDK on a machine" New topic
Author

Two JDK on a machine

zelynn goay
Ranch Hand

Joined: Jan 09, 2005
Posts: 30
hi. we have an old application that is developed using jdk1.3 and we would like to develop new application using jdk1.4.2
is it possible to have two JDK on the same machine? May I know how to set the environment variables?

thank you.
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 687
    
    1
One thing you can do when compiling a program is set the classpath to the rt.jar for the SDK that you want to use.
Another is to use the javac.exe options -source and -target to control release levels. Then I think you'd only need one SDK.
zelynn goay
Ranch Hand

Joined: Jan 09, 2005
Posts: 30
hi. thanks for your reply. however, i am still unsure how to do it. May i know how to use the javac -source -target option to control release levels?

thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
May i know how to use the javac -source -target option to control release levels?

Yes, you may - if you examine the tooldocs section of the Java documentation you will find all of the command line parameters neatly laid out.
Java documentation is currently downloadable from this page. Or - you can browse it online.
Bill
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I keep multiple versions around for similar reasons. My primary project must be WSAD on 1.3, and I play with the latest Eclipse and JDK. I ignore whatever registry entries and environment variables the installation sets and manually set everything I need as I start things up.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Or you can use a bat file.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Marilyn de Queiroz:
Or you can use a bat file.


Or a shell script if your aren't using Windows

Layne


Java API Documentation
The Java Tutorial
 
jQuery in Action, 2nd edition
 
subject: Two JDK on a machine