Setting up java classpath on ubuntu

java_ubuntu

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:

PATH=$PATH:/usr/lib/java/jdk1.6.0_13/bin

export PATH

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

screenshot-12

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.

Thanks.

This entry was posted in Tutorials, developer, java and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

So far 1,110 views

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

  • Become a GaanZa Fan

    GaanZa on Facebook