This article is being pulled from the Getting Started and Manual Eclipse Java Tomcat Setup documents from www.tinframework.homeip.net.
There is a working implementation of this for SiteMesh at the SiteMesh Wiki.
The BonsaiFramework uses a portable development environment that is composed of the following components,
- Eclipse
- Java
- Tomcat
To get quickly started download the package that matches your operating system.
Package |
Operating Systems |
---|---|
Win.32bit_Eclipse.x.x-JRE.1.6_18_32-bit-Tomcat.6.0.26_x86_32-bit.zip |
Windows XP - Windows 7 |
Win.64bit_Eclipse.x.x-JRE.1.6_18_64-bit-Tomcat.6.0.26_x86_32-bit.zip |
Windows 64-bit XP - Windows 7 |
Linux_Eclipse.x.x-JRE.1.6_18_32-bit-Tomcat.6.0.26.zip |
Ubuntu 8.x - Current |
Win.64bit_Eclipse.x.x-JRE.1.6_18_64-bit-Tomcat.6.0.26_x86_32-bit |
Ubuntu 64-bit 8.x - Current |
Let's try and do Eclipse using Java 64 but then have Tomcat 32-bit use Java 32-bit.
Unzip the package and launch Eclipse.
Following the portability principle of the Bonsai Framework there is no installer and the software is isolated from the operating system.
The remainder of this document provides details about how to build/adjust the portable environment yourself. These same instructions should also work for the SpringSource Tool Suite.
Eclipse Setup
Download Eclipse IDE for Java EE Developers.
Select Location
Select a drive and directory your computer where you will be keeping everything. The Bonsai Framework uses,
- Windows = C:\apps\
- Linux or Unix = /home/[your home directory]/apps for example, /home/tpham/apps/
Setup Package Java
Download Oracle's JRE (Java Runtime Environment) and follow the manual Java setup instructions.
Move the Java folder into your eclipse directory. For example,
- Windows = C:\apps\eclipse\jre1.6.0_18
- Linux or Unix = /home/tpham/apps/eclipse/jre1.6.0_18
Modify eclipse.ini
Modify the eclipse.ini to point to your JRE with by adding -vm and a reference to Java.
Two key thing to keep in mind,
- You can not mix 32-bit and 64-bit. For example, running Eclipse 32-bit and Java 64-bit will not work.
- Placement of the -vm option is very important. The -vm option must occur before the -vmargs option.
- If everything appears on one line use a better free editor like Notepad++.
There does not seem to be a way to comment in the eclipse.ini. Let me know if you figure out a way.
Here is an example of what the eclipse.ini would look like for Windows,
-startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519 -product org.eclipse.epp.package.jee.product --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m # --------------------------- # Start Bonsai Framework # ----------------------- # Use local version of Java. # Note, these lines must come just before -vmwargs -vm jre1.6.0_18\bin\javaw.exe # ----------------------- # End Bonsai Framework # --------------------------- -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m
Here is an example of eclipse.ini for Unix or Linux,
-startuplugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar--launcher.library-startup plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.2.R36x_v20101019_1345 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile # --------------------------- # Start Bonsai Framework # ----------------------- # Use local version of Java. # Note, these lines must come just before -vmwargs-vm jre1.6.0_18/bin/java # ----------------------- # End Bonsai Framework # --------------------------- -vmargs -Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m
See Specifying the JVM at the Eclipse Wiki for more deteails.
Setup Tomcat
Similar to Eclipse, Tomcat also is also packaged without an installer. For windows we download the x86 .zip and for Linux or Unix download the .tar.gz file. Following the Bonsai Framework standards, decompress to the following folder,
- C:\apps\eclipse\apache-tomcat-6.0.24
- /home/tpham/apps/eclipse/apache-tomcat-6.0.24
Launch Eclipse
Start Eclipse by running the Eclipse executable included with the release. In our example the directories would be,
- Windows = C:\apps\eclipse\eclipse.exe
- Linux or Unix = /home/tpham/apps/eclipse/eclipse
Configure Eclipse to Use Tomcat
...
Ok this is where we have a problem. Once the Tomcat instance is created there seems to be no way to dynamically specify the various classpath entries... double-click on the server, Overview, Open Launch configuration, Classpath.
There it is hard coded. As soon the eclipse directory changes, the server stops working. Tried various variable options with Garth without success.
...