Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

Two tomcats & two VMs on same box

Thread view: 
Mike - 11 Jun 2006 15:00 GMT
I have tomcat 4.0 running with jdk 1.4. I tried starting up tomcat 5.5
after installing jdk 1.5 and exporting the later as the JAVA_HOME. It
seems that one VM replaces the other. I assume that you can have only
one version of a VM running on a box. Is that true?
davidsouther@gmail.com - 11 Jun 2006 16:04 GMT
> I assume that you can have only
> one version of a VM running on a box. Is that true?

Not at all! You'll just have *huge* headaches with trying to sort them
out. The easiest way I can think of is what I do, put seperate VMs on
seperate boxes on a network. But that may not work for you, so we go
plan b: different user accounts for each VM.

> I have tomcat 4.0 running with jdk 1.4. I tried starting up tomcat 5.5
> after installing jdk 1.5 and exporting the later as the JAVA_HOME. It
> seems that one VM replaces the other.

I'm a Windows guy, so what I'm about to say will be windows-specific,
but shouldn't be that hard to change for *nix.

Zeroith, backup all your personal libraries and uninstall everything
Java/Tomcat realated. It'll save you pains later.

First, create a user account for 1.4/4.0. Install Java to
%user_root%/java, and tomcat to %user_root%/tomcat, or however. Now,
create a second account for 1.5/5.5, and do the same. Here's where
things will get tricky. You don't want both JVMs using the same libs
and bins, but yet there will be some that you don't want to copy over.

So, decide what you want VM specific, and what you want general. Now,
put these in their own directories, eg %user1%/java/lib,
%user2%/java/lib and %super%/java/lib. Here's where we get
Win-specific. Go to System Properties (right-click my computer,
properties) and go to the "Advanced" tab (this is win2k/XP), and click
on "Environment Variables". On the bottom half, find the variable
CLASSPATH. This will be teh universal library for all JVMs, point it at
%super%/java/lib. Switch to one of the user accounts, and go back to
this screen. This time, we'll be setting this variable in the top box.
Click New, add CLASSPATH and point it at %user1%/java/lib. Switch
users, and set it up again for user 2. Now, they *should* all be
playing nicely.

Go into task manager, and view users. All three should be logged in
nicely. Look at runnning processes. You should have two java.exe, one
with each user, and two tomcats (I may be wrong on that, I don't use
Tomcat myself, so I'm not sure the exact process name).

Oh, I forgot; make sure to point each tomcat at it's respective JVM
(%user%/java/jre/bin/java.exe), and make sure they're NOT on the same
port.

Best of luck!

David S
lordy - 12 Jun 2006 01:22 GMT
> I have tomcat 4.0 running with jdk 1.4. I tried starting up tomcat 5.5
> after installing jdk 1.5 and exporting the later as the JAVA_HOME. It
> seems that one VM replaces the other. I assume that you can have only
> one version of a VM running on a box. Is that true?

Certainly on *nix boxes you can have as many JVMs as you like.
On windows you can too - but you have to be careful with the registry
infomation. One option may be to clear registry keys that refer to the
default JVM (this may be doable from the Java Control Panel Applet?)
and make sure JAVA_HOME is set explicitly in each of your tomcat
startup scripts.

Lordy


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.