Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Pulling content from mhy old wiki.

...

On Windows we can not make it totally portable , (if you want the nice gui system tray and Windows Services entry) but we can make use of multiple instances. As such, I call this semi portable.

Manually Setup JRE

I install the version of Java I want on a test machine such as a VM and then copy the uncompressed Java folder over to your server and rename it according to the Linux instructions. For this example, C:\opt\jre1.6.0_16.  The main advantage is here is there are no entries in your registry and no automatic updates of Java (which I find can cause problems).

For older of Java versions go to the  Java Archives site.

Manually Setup Tomcat

Tomcat on Windows is also set up to run without requiring an installation. Some of this stuff is done by the Tomcat installer version, however, the installer can not handle multiple instances for vertical scaling. Investing the time in this article will allow you full control.

The first step is to download the zip version of Tomcat for Windows.

Unzip the folder to C:\opt. We will use the convention, C:\opt\apache\tomcat-a. The letter a designates an instance. As we scale up, you can have another instance called b, c and so forth.

Running Tomcat with a specific JRE version

Create a file called setenv.bat with the following contents using a plain text editor such as notepad,

Code Block
langhtml
SET JRE_HOME=C:\opt\apache\java

Verify your change using version.bat you will see the following results,

Code Block
version.bat
Using CATALINA_BASE:   "E:\opt\apache-tomcat-6.0.26-a"
Using CATALINA_HOME:   "E:\opt\apache-tomcat-6.0.26-a"
Using CATALINA_TMPDIR: "E:\opt\apache-tomcat-6.0.26-a\temp"
Using JRE_HOME:        "E:\opt\jre1.6.0_20_32-bit"
Using CLASSPATH:       "E:\opt\apache-tomcat-6.0.26-a\bin\bootstrap.jar"
Server version: Apache Tomcat/6.0.26
Server built:   March 9 2010 1805
Server number:  6.0.26.0
OS Name:        Windows 2003
OS Version:     5.2
Architecture:   x86
JVM Version:    1.6.0_20-b02
JVM Vendor:     Sun Microsystems Inc.

That's it, Tomcat will actually run and start if you run it from the command line, however, Windows is not designed to run command line applications so see the next section.