Tuesday, April 28, 2009

How do I set JAVA_HOME in Ubuntu so it works

I recently installed Ubuntu 9.04. And then I installed eclipse. I am trying to start it from an icon (yes, its via an icon... don't judge!) and am having an issue with setting the JAVA_HOME and PATH variables correctly.

When I kick off from a bash shell, the PATH is correct. But not from the panel in gnome. Of course, in the bash shell, I have both those variables set in ~/.bashrc. However, when I log in via the gdm, that file does not get read. I am trying to figure out what file gets read when I login so I can set the JAVA_HOME variable. I tried adding it to /etc/environment file, but I am at a loss as to how to add $JAVA_HOME/bin to the $PATH variable. For now, I start eclipse via the icon using

/usr/local/eclipse -vm /usr/local/jdk1.6.0_13/bin/java
and that works just fine for me...

Do I need the Java EE editor to work with Tomcat

I am pretty certain that all I have at work is a regular Java IDE and I am able to muck about with Tomcat... mind you, I don't deploy anything onto Tomcat via a 'Server' option. So, how come I can't do that easily with my regular IDE? I tried to install the Java EE development patches via Eclipse and it threw an error at me. I've seen the same requirement for some glassfish tutorials I was following before.

Is it because of that 'Server' feature that I need the EE version of Eclipse? I don't mind installing it, I was just curious. Anyone know?