-1

I have already installed JDK in my 12.04, but i don't know how to compile .java files in Terminal. I used javac FILENAME.java then java FILENAME in terminalbut this shows error like this

javac: file not found: sum.java

Usage: javac

use -help for a list of possible options

Ganesh Prasad
  • 19
  • 2
  • 8

1 Answers1

1

Your current working directory in the terminal needs to be the same directory that has the sum.java file in it. The cd command is used to change directories in the terminal. Then the usage is the same as you wrote in your question, and it's also in: How to run a Java program in Ubuntu if you want to see another example.

karel
  • 114,770