Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed j2ee with j2sdk on my Ubuntu 12.04 computer. It is installed at /mallika/glassfish3/jdk7/.

I am able to run any of my Java programs in Netbeans using this JDK.

Since Netbeans 7 does not support RMI programs, I tried to compile these from command prompt, but then I get the following error on giving the following command:

..~$ javac rmiclient/ 
The program 'javac' can be found in the following packages:  
 * default-jdk  
 * ecj  
 * gcj-4.6-jdk  
 * openjdk-6-jdk  
 * gcj-4.5-jdk  
 * openjdk-7-jdk  
Try: sudo apt-get install <selected package>  

My system now has both OpenJDK (I do not know where) and JDK 7 as I mentioned above. How do I set path or something so that I can compile Java sources from command prompt.

share|improve this question
Which Java versions did you installed through the package-management-system? – BuZZ-dEE Feb 6 '13 at 12:12

You could install the OpenJDK versions (openjdk-6-jdk or openjdk-7-jdk):

sudo apt-get install openjdk-6-jdk
sudo apt-get install openjdk-7-jdk

If you need the Oracle Java JDK have a look at:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.