File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Setting different JDK versions for Different webapp in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Setting different JDK versions for Different webapp in Tomcat " Watch "Setting different JDK versions for Different webapp in Tomcat " New topic
Author

Setting different JDK versions for Different webapp in Tomcat

Manoj Tyagi
Ranch Hand

Joined: Jun 11, 2002
Posts: 35
Hi All,

I have 2 web-applications in Tomcat 5. Now for Java I have j2sdk1.4.2 & j2sdk1.3..

Now One of my application needs j2sdk1.4.2 while other can run only with
j2sdk1.3.. (This is an old project & there are java class package norms - like every class should be in a package to import it now. But earlier it was not strict).

Means this is absoulte for me to run one application with version 1.3 while other with 1.4.

But I can set Java_Home env. varibale only once. How can I tell my each web-application to take thier own jdk version in compiling & running.
Is this allowed in J2EE/Web-Containers.

Please suggest if there is any such setting which makes it possible.

THanks you all in advance...

Manoj
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I don't think that you can do this without running 2 instances of Tomcat. Tomcat is a Java program and any web applications running in a Tomcat instance run in the same JVM. You would have to specify different JAVA_HOME values in the batch file that launches each instance, and you would have to specify a different port for each instance to run on.

It is probably a better idea just to fix the uses of the default package and not bother with running 2 Tomcat instances.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Moving to the Tomcat forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting different JDK versions for Different webapp in Tomcat
 
Similar Threads
problem with import statement
Almost have AdviceClient run, but.... help!
User defined Class Loader - restrict loading classes based on package structure
String class can't find split method: wrong java version?
How set java path for a perticular apache server ?