File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Two JDK on a machine" Watch "Two JDK on a machine" New topic

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: 691
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?

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13025
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.
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

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

"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


Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: Two JDK on a machine
jQuery in Action, 3rd edition