Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting different JDK versions for Different webapp in Tomcat

 
Manoj Tyagi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Tomcat forum.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic