Development Environment

The following development is suggested for building and running LAMS. Some of the software, such as JBOSS, is required. Others, like the IDE is recommended but not required - you can use another program in its place. Note: this software is used for Java development - further software is required for Flash development.

Suggested locations are given for Windows installations. Using the suggested locations will reduce the number of changes needed in the configuration files. We suggest installing them in this order. You can swap around JBOSS, MySQL if you want.

If you are part of the MELCOE group, then a copy of the software is on the "Shared Software" directory on the shared drive.

JDK

Required? Yes
Version: Java 6 or Java 5 (1.6 / 1.5)
Source
See Installing Java

JBOSS

Required? Yes
Version: 4.0.2
Suggested Location (Windows) D:\
Source www.jboss.org    http://labs.jboss.com/portal/jbossas/download
Comments 4.0.3SP1 and 4.0.4 have problems running LAMS, so 4.0.2 is your best bet until we fix the problem.

MySQL

Required? Yes
Version: 5.0.
Suggested Location (Windows) C:\Program Files\MySQL
Source See Installing MySQL
Comments It is recommended that the installation of MySQL be on a different disk to the JBOSS installation if you have more than one hard disk on your computer. This is mainly for performance reasons - if you wish to do this you would need to consider your overall environment e.g. use of RAID on your hard disks.

MySQL Administrator

Required? No. If you are happy using the MySQL command line utility or if you have another database GUI manager program for MySQL (e.g. DBManager Professional)  you don't need the Administrator program. But if you are new to MySQL we recommend you download this utility. Our instructions for configuring the database use this utility.
Version: 1.1
Suggested Location (Windows) C:\Program Files\MySQL
Source http://www.mysql.com    http://dev.mysql.com/downloads/administrator/1.1.html


Eclipse

Required?
No if all you want to do is build LAMS. Handy in other caes (see the comments below).
Version: 3.1.1, 3.1.2, 3.2 or 3.3 (Europa)
Suggested Location (Windows) D:\eclipse
Source http://www.eclipse.org
Comments
If you want to explore the code or do some development then Eclipse may be useful. If you want want to view/update the database schema diagrams (as you need it for Clay) or you want the convenience of using our build files and our configuration instructions, then use Eclipse. If you want to use another IDE (or a text editor and ANT) and are prepared to do all the setup for your IDE, then you don't need Eclipse.

If you install the latest version (3.3), you can download the "Eclipse IDE for Java EE Developers" package and that will give you the web tools and J2EE tools automatically. Then follow the "Installing Web Development Support, and how to run JBoss" below, but you can skip the bit that gets the web tools and the J2EE tools. If you download just the Eclipse IDE, the you will need to download the web tools and the J2EE tools from the Europa discovery site (read the instructions below for more information).

If you install Eclipse 3.2 we suggest you get the "Web Standard Tools" and "J2EE Standard Tools" software updates. See "Installing Web Development Support, and how to run JBoss".

Once you install Eclipse it is recommended that you download and import formatter configuration and clean up configuration used by LAMS developers.

MyEclipse

Required? No - it is only useful if you are running Eclipse 3.1.1 or 3.1.2
Version: 4.0.3 (with Eclipse 3.1.1) thru to 4.1.1 (with Eclipse 3.1.2)
Suggested Location (Windows) D:\Program Files\MyEclipse
Source http://www.myeclipseide.com
Comments
MyEclipse makes development using Eclipse easier as it bundles in many plugins, including the JBOSS support. Eclipse must be installed before installed MyEclipse.  The MELCOE team used MyEclipse with the 3.1.x versions of Eclipse, but we are using Eclipse 3.2 without it (see the Web Toolkit below).

The versions given here are versions that we have tried and seem to work okay. 

MyEclipse is not free so we have tried to ensure that you don't need it to develop LAMS. But we mention it as we have found it useful in the past. Now most of the functionality we used is easily available via the "Discovery Site" updates for Eclipse 3.2, 3.3, etc so we don't use it any longer.

Clay

Required? Yes if you want to view/update the schema diagrams
Version: 1.2.0
Source http://www.azzurri.jp/en/software/clay/
Comments Clay is an Eclipse plug-in. We use it to do our database models, and to generate some of our SQL scripts. If you aren't using Eclipse and hence can't use Clay, then you will not be able to view the database models. You can download the plugin and install it manually, or you can do it from within Eclipse 3.2 (see instructions below "Configuring Clay").

ANT

Required? Yes
Version 1.5.x
Source Your IDE or http://ant.apache.org/bindownload.cgi
Comments Version built into Eclipse is fine. If you don't have Eclipse or another Java development environment with ANT, download ANT from the Apache website.

JUnit

Required? No. It is only used if you want to run the LAMS JUnit test cases. If you don't know what JUnit is or what we mean by test cases, then you don't need JUnit.
Version 3.8.1
Source Your IDE or http://www.junit.org/
Comments Version built into Eclipse/MyEclipse is fine. If you don't have Eclipse or another Java development environment with JUnit you can download it from the JUnit website.

Wildfire or Other Jabber Chat Server

Required? Yes if you want to run the chat tool
Source See Installing Wildfire
Comments Theoretically any Jabber server should work. At present, we only have it working with Wildfire 2.6.2.

Help!

Q: The recommended JDK is v1.5/v1.6 but on the Sun website, it has JDK 5.0/6.0, is that the same thing?
A: Yes. The "numbers" for Java keep changing. For the purposes of building LAMS, 1.5 = 5.0, 1.6 = 6.0.

Q: Do I need to Download the J2EE1.4 (includes JDK 5.0)?
A: No you do not. The build process uses the J2EE libs from JBOSS.

Q: Someone has said that I need the Java SDK, and not the JDK.
A: They mean the JDK - it gets called SDK by some longer term Java programmers. What you need to avoid is having only the Java runtime (JRE) - that is enough to install Eclipse but it is not enough to run JBOSS from Eclipse.

Q: I have a MyEclipse and an Eclipse icon. Which one should I start?
A: Either - they both will start Eclipse.

Q: I'm trying to configure Eclipse but I don't see the toolbar you are talking about.
A: If this is the first time you have run Eclipse then there may be a welcome screen showing. If the welcome screen is there, close it and you should get the toolbar.

Configuring Eclipse JDKs and JDK Version Compliance

This assumes that you are using Eclipse.

  • Go to the menu and select Window -> Preferences.
  • Preferences window comes up.
  • Open Java section, select installed JREs. It will default to your Java runtime (JRE) usually. You need to set up your JDK.
  • Click "Add" button.
  • An "Add JRA" window comes up. Make the name JDK 6 (or similar) and point the home directory to the JDK you installed e.g. C:\Program Files\Java\jdk1.6
  • Leave the JRE type as standard.
  • Click okay to close the window and go back to the list of Installed JREs.
  • Change the little tick box so that the JDK 6 is ticked, not the JRE, then click okay to close the preferences window.
  • Select Java -> Compiler.
  • Change "Compiler Compliance Level" to 5.0.
  • Leave "default compliance settings" and all the classfile generation options turned on.

Configuring Eclipse code formatter and clean up

LAMS developers are using common Java source code formatting and clean up configuration. It allows focusing on meaningful changes when comparing and commiting Java files. These configurations basically follow the default settings with slight changes that LAMS development team found useful.

  • Download formatter configuration and clean up configuration.
  • Go to the menu and select Window -> Preferences.
  • Preferences window comes up.
  • Select Java -> Code Style.
  • Select Formatter, click "Import..." button and choose the downloaded formatter configuration file.
  • Select Clean Up, click "Import..." button and choose the downloaded clean up configuration file.

Configuring Code Templates

When you set up the software, please configure your IDE to insert the correct license and CVS keyword statements automatically.

Eclipse 3.3/3.2: Installing Web Development Support, and how to run JBoss

If you are running Eclipse 3.3 or 3.2, this is how you can run JBOSS from within Eclipse. This section assumes that you have JBOSS already installed and Eclipse is running the JDK is configured.

Part 1: Install the  "Web Standard Tools" and "J2EE Standard Tools"

  • Go to the Help menu and select Software Updates, Find and Install
  • On the dialog box that pops up, select "Search for new features to install" and click "Next"
  • Click the Europa or Callisto Discovery Site checkbox and click "Finish"
  • This should bring you back a list including "C and C++ Development", "Java Development", "Web and J2EE Development".
  • Open "Web and J2EE Development" and select "Web Standard Tools" and "J2EE Standard Tools". Click on "Select Required" and the other needed items will be selected for you.
  • When you are ready, Click "next" and go through the screens to install these features.
  • Allow the installer to restart Eclipse if it needs to do this.
  • When it is all installed, follow the same process but this time select the option to "Search of updates" rather than get new features. This should ensure you have the latest copy of the installed products.

Part 2: Add JBOSS

  • Once "Web Standard Tools" and "J2EE Standard Tools" are installed, go to Preferences->Server->Installed Runtimes.
  • Click the Add button and select JBoss 4.0.2 from the type of Servers which Eclipse supports.
  • In the next dialog, choose JRE (you must have chosen a JDK for this as described earlier) and Browse to the server's root directory.
  • Click finished. Now the Server can be accessed from various parts of Eclipse.

Part 3: Configure JBoss

  • Go to your Project perspective.
  • From the Menu, select Window->Show View->Other...->Server.
  • Expand the Server and click Servers.
  • A new tab called Servers should be added in the Console pane of the Project Window.
  • Right click mouse inside the Servers panel to get a popup menu "New" and select "Server".
  • New Server dialogd opens.
  • click open JBoss and select JBoss v4.0 and click Next.
    • If you skipped Part 2 above, you will be asked to do it here now.
    • Or using the Installed Runtimes button, you can create more servers or toggle between servers.
  • Leave the port, host IP, JNDI port, servier config (dafelut) as they are and click Next.
  • Skip the next dialog asking what Project to add (just click Fiish). Do not set up any projects on the server.
  • You should now have an entry for JBoss v4.0 on the server tab.
    • There is also a new Project called Servers in Eclipse now.
  • Start JBoss by right mouse clicking on the JBoss v4.0 and selecting start.

One advantage of this method of starting JBOSS from Eclipse (over the older MyEclipse method) is that you can now have more than one 4.0.x version of JBOSS configured on your PC and be able to switch between versions easily. This won't affect many developers but it is handy when we are trying out other versions of JBOSS.

Eclipse 3.1.x: Configuring MyEclipse and JBOSS

If you are running Eclipse 3.1.x, this is how you can run JBOSS from within Eclipse using MyEclipse. You can also do this via free plugins - you don't have to do it via MyEclipse. This section assumes that you have MyEclipse and JBOSS already installed, Eclipse is running the JDK is configured.

  • Open the preferences window and go to myeclipse -> application servers -> jboss 4.
  • Set server to enabled.
  • Check jboss home directory is where you installed jboss
  • Select the JDK option (under JBoss 4) and select the 1.5 JDK. Set the optional Java VM args to "-Xms256m -Xmx256m" (without the quotes).
  • If you want to run the debugger while running JBOSS, select "Launch" (under JBoss 4) and select "Debug mode".
  • Close the preferences window.

Now try starting JBOSS. In your toolbar, about the 5th icon along should be a little server with a green arrowhead on it. Click on the icon and you should get a drop down list with JBOSS 4. Select JBOSS 4 then start. You should see messages in the console window.

Eclipse 3.3/3.2: Configuring Clay

To download and install Clay:

  • Go to the Help menu and select Software Updates, Find and Install
  • On the dialog box that pops up, select "Search for new features to install" and click "Next"
  • Click "New Remote Site"
  • In the name text field, type "Azzurri Plugins"
  • In the URL text field, type "http://www.azzurri.jp/eclipse/plugins"
  • Click OK.
  • Azzurri Plugins should appear in the list and be checked. If it isn't, turn on the checkbox. Click Next.
  • It will then load up the data from the plugin website. When ready, expand the Azzuri entry and select the 1.2.0 Core Edition and click Next to install.
  • Go through the screens to install these features.
  • Allow the installer to restart Eclipse if it needs to do this.

Configuring JUNIT in Eclipse

This assumes that you are running Eclipse and have either (a) Eclipse 3.2, (b) Eclipse 3.1.x and MyEclipse or (c) junit.jar version 3.8.1 from somewhere.

  • Go to the preference dialogue.
  • Select ant -> runtime
  • Open up the "Global Entries" section.
  • Check that you have c:\java\jdk1.6.\lib\tools.jar or something similar. If not, add tools.jar using "Add External JARs". The jar file is in the lib directory of your JDK.
  • Add the junit jar file using "Add External Jars":
    • If you are using Eclipse 3.2, use (eclipse directory)/plugins/org.junit_3.8.1/junit.jar
    • If you are using Eclipse 3.1.x, work out where MyEclipse was installed and add the junit.jar from MyEclipse. e.g. d:/eclipse/plugins/org.junit_3.8.1/junit.jar.
    • If neither of these apply, you install junit on your PC and add that copy of the junit jar to the Global Entries.

Configuring the J2EE libraries on the Build Path in Eclipse

If you are working on the LAMS code, you should set up the j2ee libraries on the project's the build path. This is useful for code completion and syntax checking. It doesn't need to be done if you are only using Eclipse to build and run LAMS.

  • Go to the preference dialogue.
  • Select java -> build path -> classpath variables
  • Select "New" to add a new variable entry
  • In the "Name" text field, type "JBOSS_HOME"
  • Select "Folder" to locate your jboss folder
  • Select OK and close the preference dialogue.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.