When u install sun’s jdk manually on ubuntu, java classpath doesn’t get set automatically unlike in windows. So when you enter command javac in terminal window, it says “javacĀ  command not found”. So here is the very simple way to set up the classpath for java on ubuntu.

STEP 1 : Open the terminal window.

STEP 2: Type sudo gedit /etc/bash.bash.rc. Press enter.

STEP 3: Now gedit editor will open up. Now at the end of file just write:


export PATH

**You have to provide the path of bin folder in java installation deirectory.**


STEP 4: Now save the file and close the editor and terminal. Open new terminal window and type javac and press enter, all the java options and flags will come up.

Thats it.