The SSK (SiteMesh Starter Kit) eventual goal is to create a portable development environment.
At present, v0.1 is simply a bundling of an Java Editor, Application Server and Java which does not require an install.
It is composed of the following components,
- SpringSource Tool Suite (a variant of Eclipse)
- vFabric tc Server (a variant of Tomcat)
SpringSource Tool Suite (STS) was selected over Eclipse as it comes pre-packaged with a version of Tomcat.
The detailed instructions of how setup the SiteMesh Starter Kit is also useful to those new to Java Web Application development.
Note, the SSK is not truly portable yet. SpringSource Tool Suite hard codes path names. The current work-around is to have users import the demo war file.
Select a drive and directory your computer where you will be keeping everything. This example will use,
- Windows = C:\apps\
- Linux = /opt/apps/
Setup Package Java
Move the Java folder into your eclipse directory. For example using JDK 1.6.0_26
- Windows = C:\apps\sts-2.8.0.RELEASE\jdk1.6.0_26
- Linux or Unix = /opt/apps/sts-2.8.0.RELEASE/jdk1.6.0_26
Point STS to Java
Modify the STS.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++.
Note the comments have only been tested in Windows.
Here is an example of what the STS.ini would look like for Windows,
-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502 -product com.springsource.sts.ide --launcher.defaultAction openFile --launcher.XXMaxPermSize 384M # --------------------------- # Start Bonsai Framework # ----------------------- # Use local version of Java. # Note, these lines must come just before -vmwargs -vm jdk1.6.0_26\bin\javaw.exe # ----------------------- # End Bonsai Framework # --------------------------- -vmargs -Dosgi.requiredJavaVersion=1.5 -Xmn128m -Xms256m -Xmx768m -Xss1m -XX:PermSize=128m -XX:MaxPermSize=384m
See Specifying the JVM at the Eclipse Wiki for more details.
Start Eclipse by running the STS executable.
The selected workspace will be,
- Windows = ..\workspace-sitemesh\
- Linux = ../workspace-sitemesh/
Check "Use this as the default and do not ask again"
Create Web Work Space
Stopped here. For portability this does not work. As soon as the web application workspace is created, the tomcat server is bound to the current working directory. Will post questions at SpringSource, Eclipse and Tomcat to see if this can made to be relative paths.
In STS click,
File, New, Dynamic Web Project
You will be prompted with a Dynamic Web Project dialog box. Leave everything as default and enter cafe as the Project Name.
Click Next to proceed to the Java dialog box.
Click Next o proceed to the Web Module dialog box and check the box beside Generate web.xml deployment descriptor.
You will be prompted to switch to the Java EE perspective. Click Remember my decision and then click Yes.
Optionally, I prefer to use the Navigator which shows the real file system,
Window, Show View, Navigator
The Environment is now ready for use.
Packaging the Portable Development Environment
I was able to successfully package the environment using 7-Zip. Other tools may work too, but this has been tried and tested.