Ubuntu and writing Java servlets
The problem was with this little itty bitty smidge of code:
/** * hello.java */ import javax.servlet.*; class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } }
Everytime I wanted to compile this, I got something like "Could not find javax.servlet. blah blah" So, eventually, I just pulled an apt-cache search j2 (for j2ee) and saw an entry for libservlet2.4-java. Hmmmmm, what the heck is that I wondered. I installed it and went to the Ubuntu site to look at what files were installed and sure enough:
/usr/share/java/jsp-api-2.0.jar /usr/share/java/jsp-api.jar /usr/share/java/servlet-api-2.4.jar /usr/share/java/servlet-api.jar
Perfect! I added these paths to my CLASSPATH variable in my .bashrc and whamo, I'm in business and flaunting my little HelloWorld.class file all around town.
I hope this helps someone else!