-4

I write a small java program to read file and do the string matching in windows 8 by using net beans. But when i compile it on ubuntu by using terminal following message appeared. Is there any default packages in ubuntu , for following packages in the error.

The program 'javac' can be found in the following packages:
 * default-jdk
 * ecj
 * gcj-4.6-jdk
 * gcj-4.7-jdk
 * openjdk-7-jdk
 * openjdk-6-jdk
Try: sudo apt-get install <selected package>
ucsc@ucsc-VirtualBox:~/Desktop/Question$ 
  • possible duplicate of [Installing Java 7 on Ubuntu](http://stackoverflow.com/questions/16263556/installing-java-7-on-ubuntu) – Shashi May 08 '14 at 05:47

3 Answers3

0

You do not have javac, the java compiler installed. Follow the recommendation given - install one from the variations offered. I'd suggest openjdk-7-jdk.

indivisible
  • 4,892
  • 4
  • 31
  • 50
0

You don't have a java compiler installed (javac). Use 'sudo apt-get install openjdk-7-jdk' to install it.

gratz
  • 1,506
  • 3
  • 16
  • 34
0

You don't have a JDK installed on your ubuntu system so the javac command to compile your program doesn't exist. Just run the command like it says to install something that has it. I would go with defualt-jdk since I assume that Ubuntu would know to download the Java8 packages in an update when they are switched to be the default while the openjdk ones will not.

sudo apt-get install default-jdk
Andrew Vitkus
  • 827
  • 7
  • 9
  • 1
    While a good suggestion, letting the OS update your dev environment can lead to future weirdness and hard to track down bugs. I prefer to manually control versions to allow you to define an exact, reproducible environment. You can always manually update down the line. – indivisible May 08 '14 at 05:53
  • Very good point, in a production environment I would agree that is by far the best course of action; however, I'm guessing that the reproducibility is less important than up to date-ness in this situation. I would guess that they are a student so their version updating automatically to have all the new features of the language could help with a lot of headaches later when your supposedly valid code doesn't compile. – Andrew Vitkus May 08 '14 at 06:13