veronique
veronique

Reputation: 31

Can I have applications using Java 1.4.2_12 and Java 1.5 on the same windows server

I have a couple of applications running on Java 1.4.2_12 and now need to add an new application that uses Java 1.5. Can I have both java versions on a windows server?

Upvotes: 3

Views: 561

Answers (5)

Dennis C
Dennis C

Reputation: 24747

I could suggest you to use Java WebStart, which allow you specific the target J2SE version in the JNLP file. Or; always execute the right version "java.exe" under "Program Files" by absolute path.

You don't have to set CLASSPATH for JRE (and should not in modern JRE). JRE have it own bootclasspath automatically. CLASSPATH is used by your application.

Usually you won't have to set the JAVA_HOME unless your appliaction is looking for resources from JDK\lib\ (e.g. tools.jar which contains compiler)

But I am not sure what's your problem. Are you running client application(swing)? Two Java processes to provide services? or two application sharing same Java application server?

Upvotes: 0

Chris Nava
Chris Nava

Reputation: 6802

YES. See above. Of course, running two VMs (of any version) takes twice the RAM.

Upvotes: 1

matt b
matt b

Reputation: 139931

Yes. You just need to make sure that each has the correct version of Java/the JRE on its CLASSPATH, PATH and JAVA_HOME environment variables.

Upvotes: 5

Herms
Herms

Reputation: 38798

Are you sure you have to have the Java 1.4.2_12 apps run using that specific Java VM? Most apps should run fine on the newer VMs, so you might be able to simply have them all use 1.5.

If you do need to use the specific VM versions then you can do what other posters have suggested.

Upvotes: 2

VonC
VonC

Reputation: 1324308

Yes: actually JDK or JRE can be just "copied" wherever you want, not "installed" (avoiding putting anything in c:\Windows\System32)

I would also recommend not using global environment variables.

That way, your applications depend entirely on local settings (local to the application), and not on external Java installation side-effects

Upvotes: 3

Related Questions