Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Having a a portable environment to easily share among developers using the zero footprint approach service approach if possible.

Warning

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.

...

Warning

Let's try and do Eclipse using Java 64 but then have Tomcat 32-bit use Java 32-bit.

...

Eclipse Setup

You want to download the portal (tar.gz for Linux, zip for Windows) version of Eclipse and not the installer.

Tip

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.

...

  • 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.

Panel

If you are using STS on Mac OS X, first you need to use the JDK (Java Development Kit) not the JRE (Java Runtime Environment)

  1. Go to your STS installation, and right-click on STS Application
  2. Select ‘Show Package Contents’
  3. A new Finder window will open and show the content of the application bundle.
  4. In Contents/MacOS is STS.ini which is equivalent of eclipse.ini

 

Two key thing to keep in mind,

  1. You can not mix 32-bit and 64-bit. For example, running Eclipse 32-bit and Java 64-bit will not work.
  2. Placement of the -vm option is very important. The -vm option must occur before the -vmargs option.
  3. If everything appears on one line use a better free editor like Notepad++.
Note

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,

...

Info

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

If using Mac OS X you may recieve an error due to modification of the STS.ini file. To fix this switch to the directory where STS.app resides,

Code Block
languagebash
spctl --add --label "Eclise" STS.app

Actually, not sure if above fully worked. I tried and it did not seem to take. However, it started working after I I ended up switching to a root enabled account and disabling and enabling spctl. It may be adding below a  step to reboot,

Code Block
languagebash
sudo spctl --master-disable
sudo spctl --master-enable

I need to test on a fresh machine before saying 100%.

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.

...