How To Set Up Java, Eclipse, Tomcat, Ant, WTP, Subversion, Subclipse, MySQL, Spring, and GreenUML in OS X (10.4)
This is how I pulled together my Java dev environment in Tiger. I started off pretty clueless, and what guidance I could find via Google was fragmented and/or out of date. So here’s my setup. If any of you experts out there have suggestions / corrections, please send ‘em my way.
For reference, here are the versions I installed:
- Java 1.5
- Eclipse 3.2
- Tomcat 5.5
- Ant 1.7
- WTP 1.5.2
- Subversion 1.3
- Subclipse 1.0.5
- MySQL 5
- Spring 2.0.1
- GreenUML 2.5.0
1. Install OS X developer tools
2. Run software update and install all updates (esp. Java—this will update from 1.4 to 1.5)
3. Install MySQL
- There’s a nice OS X package at http://dev.mysql.com/downloads/mysql/5.0.html#downloads
- If desired, install the startup item and preference pane that come along in the install package
4. Install Tomcat 5.x
- Download the Core Binary Distro .tar.gz from http://tomcat.apache.org/download-55.cgi
- Run the following (in Terminal):
> sudo su –
> mv /Users/{username}/Desktop/apache-tomcat-5.5.20.tar.gz /usr/local/
> cd /usr/local
> gnutar -xzvf apache-tomcat-5.5.20.tar.gz
> ln -s apache-tomcat-5.5.20 tomcat
> rm apache-tomcat-5.5.20.tar.gz
> chown -R {username}:{username} apache-tomcat-5.5.20
5. Install Ant 1.7
- Download from http://ant.apache.org/bindownload.cgi
- Run the following (in Terminal):
> mv /Users/{username}/Desktop/apache-ant-1.7.0-bin.tar.gz /usr/local/
> cd /usr/local
> gnutar -xzvf apache-ant-1.7.0-bin.tar.gz
> ln -s apache-ant-1.7.0 ant
> rm apache-ant-1.7.0-bin.tar.gz
> exit
6. Install Subversion 1.3
- Download nice OS X package from http://metissian.com/projects/macosx/subversion
7. Set JAVA_HOME / CATALINA_HOME / ANT_HOME / PATH
- Create /Users/{your_username}/.bash_profile if it doesn’t already exist
- Add the following to it (using vim, emacs, or your text editor of choice):
export JAVA_HOME=â€/Library/Java/Homeâ€
export CATALINA_HOME=â€/usr/local/tomcatâ€
export ANT_HOME=â€/usr/local/antâ€
export PATH=â€$PATH:/usr/local/bin:/usr/local/subversion/bin: \
/usr/local/mysql/bin:$ANT_HOME/binâ€
8. Create a MySQL database and a user for your project
> mysql -u root
mysql> CREATE DATABASE projectdb;
mysql> GRANT ALL PRIVILEGES ON projectdb.* TO \
‘projectuser’@’localhost’;
mysql> exit
9. Install Eclipse 3.2.1
- Download from http://www.eclipse.org/downloads/
- Copy to Applications folder
10. Install Spring IDE
- Follow instructions at http://springide.org/project/wiki/SpringideCallistoInstall
11. Install Eclipse Web Tools Project (WTP)
- As for Spring IDE, go to Help > Software Updates > Find and Install
- Select “Search for new features to installâ€
- Select Callisto Discovery Site, and Web Tools Platform Updates
- In the Search Results window, select WTP Updates > Web Tools Platform and WTP Patches
- Expand Callisto Discovery Site, and click “Select Requiredâ€
- Click Next, Accept (Next), Finish, (files download) Install All
- Restart Eclipse as prompted
- Open Eclipse > Preferences
- Go to Server > Installed Runtimes
- Click “Addâ€
- Find Apache > Apache Tomcat v5.5
- Enter /usr/local/tomcat as the Tomcat installation directory
- Click Finish, then OK.
12. Install Subclipse
- Download from http://subclipse.tigris.org
- As for Spring IDE, go to Help > Software Updates > Find and Install
- Select “Search for new features to installâ€
- Click “New Remote Site…â€
- Name the site “Subclipseâ€; URL: http://subclipse.tigris.org/update_1.0.x
- Click OK
- Make sure Subclipse is selected; hit Finish
- In Search Results, expand Subclipse and select it
- Click Next, Accept (Next), Finish, (files download) Install All
- Restart Eclipse as prompted
- Open the SVN Repository perspective and define your repository
13. Install GreenUML
- Download from http://sourceforge.net/project/showfiles.php?group_id=132685
- Unzip and copy everything in the green_x.x.x/plugins folder to /Applications/eclipse/plugins
- Restart Eclipse
14a. If you have an existing project, check it out from subversion.
14b. If you need to create a new Spring project, download spring-framework-2.0.1-with-dependencies.zip from http://www.springframework.org/download
Nice post. For Subclipse, I would recommend using http://subclipse.tigris.org/update_1.2.x as the update site so that you get the version of Subclipse that targets Eclipse 3.2. Has a lot of nice new features that are worth having.