Quick setup of Ubuntu 7.04 for Java/J2EE development


After Ubuntu CD installation, install updates (orange icon in top bar) and restart.

Sudo without password

It's really convenient to setup your sudo to work without password.

Reinstall video drivers if necessary

Ubuntu isn't displayed properly with some panoramic LCD monitors (ex: LG L204WT): ATI or Nvidia drivers have to be reinstalled. Download Envy and launch it:

envy -d

Uninstall and reinstall the drivers, then restart.

Be quiet

Go to “System” menu -> “Preferences” -> “Sound”. Under the “Sounds” tab, uncheck “Enable Software Sound Mixing”. Under “System Beep” tab, uncheck everything.

Create workspaces

Five workspaces, that's what I need: Misc, Terminals, Firefox, Eclipse, Thunderbird.

Install packages for your daily Java/J2EE work

With Synaptic (“System” menu -> Administration -> Synaptic Package Manager), install:

mozilla thunderbird

Fix a Java bug which occurs during daylight saving time (Java dates are one hour off)

Change “Canada/Pacific” to the file which corresponds to your geographic location.

sudo cp /etc/localtime /etc/localtime.bak
sudo ln -s -f /usr/share/zoneinfo/Canada/Pacific /etc/localtime

Install Firefox plug-ins

Complete Tomcat configuration

Create Tomcat webapps folder:

sudo mkdir /usr/share/tomcat5.5/webapps
sudo chmod -R 777 /usr/share/tomcat5.5/webapps

Add new admin user by editing Tomcat users' file:

sudo vim /usr/share/tomcat5.5/conf/tomcat-users.xml

and adding this line:

<user username="admin" password="admin" roles="tomcat,manager"/>

Setup Eclipse

First of all, make Eclipse use Sun JVM, otherwise it will use gcj and will be horribly slow!

sudo vim /etc/eclipse/java_home

Add this line at the top:


To show the line numbers go to “Window” menu -> “Preferences”: “General” -> “Editors” -> “Text Editors”: Check “Show line numbers”. While you're here go to “Java” -> “Editor” -> “Typing”: check “Automatically insert at correct position semicolons”, same for “braces”.

Setup your terminal

Edit Terminal current profile: “Edit” menu -> “Current Profile”: Scrolling > Scrollback: set to 3000.

Complete your .bashrc. Here's mine:

export PATH=$PATH:~/bin
# Environment
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
export CATALINA_HOME=/usr/share/tomcat5.5
# Utils
alias cdd='cd ~/Desktop'
alias l='ls -lh'
alias lr='ls -lrth'
alias ll='ls -lh | more'
alias lll='ls -alh'
alias vi='vim'
# Prompt
#PS1="[\t \w]"
PS1="\e[0;34m[\e[0;31m\t \e[0;35m\w\e[0;34m] \e[0m"
# Tomcat
alias tstart='sudo /usr/share/tomcat5.5/bin/catalina.sh start'
alias tstop='sudo /usr/share/tomcat5.5/bin/catalina.sh stop'
alias trun='sudo /usr/share/tomcat5.5/bin/catalina.sh run'
alias t1='tstart'
alias t0='tstop'
alias tps='ps aux | grep tomcat'
alias cdt='cd /usr/share/tomcat5.5/webapps'
alias cdl='cd /usr/share/tomcat5.5/logs'
alias cl='cat /usr/share/tomcat5.5/logs/catalina.out'
alias ccl='echo > /usr/share/tomcat5.5/logs/catalina.out'
alias rl='ant && t0 && sleep 2 && tps && t1'
# PostGreSQL
alias pgstart='sudo /etc/init.d/postgresql-8.1 start'
alias pgstop='sudo /etc/init.d/postgresql-8.1 stop'
alias pgst='sudo /etc/init.d/postgresql-8.1 status'
# Subversion
alias stm='svn status | grep "M "'
alias st='svn status'
alias di='svn diff'
# Apps
alias thunderbird='mozilla-thunderbird'
alias nedit='XLIB_SKIP_ARGB_VISUALS=1 nedit'
# Database
alias db='psql test01'
alias dbbackup='pg_dump test01 | bzip2 >  ~/archive/backup/db/test01_`date +%Y-%m-%d_%HH%M`.dump.bz2'