How to get Debian Linux, Resin and Java Playing Nicely

Just rebuilding a server of mine and realised I should document the install process required to run my java app on my debian linux server. Few assumptions made here, but this should get you and your app up and running pretty easily.

First of, grab java from sun.com. At the time of writing, this worked for me.

cd /usr/src/ wget http://download.oracle.com/otn-pub/java/jdk/6u24-b07/jdk-6u24-linux-x64.bin chmod +x jdk-6u24-linux-x64.bin ./jdk-6u24-linux-x64.bin

Now we do some tricks to get the Java environment all linked in ok.

cd /usr/local/ mv /usr/src/jdk1.6.024/ . ln -s /usr/local/jdk1.6.024/ /usr/local/jdk

Add the following lines to the bottom of your /etc/profile to automatically make sure you Java required environment variables are published.

nano /etc/profile > export PATH=$PATH:/usr/local/jdk/bin > export JAVA_HOME=/usr/local/jdk

Then run this to load the variables into your current session.

source /etc/profile

Now we grab resin and compile it. If there is an error, just read the messages and see if you can figure out the issue. Google or post it back here if you need further help.

wget http://www.caucho.com/download/resin-4.0.16.tar.gz tar zxf resin-4.0.16.tar.gz cd resin-4.0.16 ./configure make make install mkdir /var/log/resin /etc/init.d/resin start

Finally, copy the Java program to the directory. My application automatically places the files in the right places, that can be a post for another time.

/var/www/webapps/