Java programming on BOSS GNU/Linux

Most people start learning Java on Windows by writing code on Notepad and them compiling it using the command line javac (compiler) and java(interpreter). This post tell you how to do something similar on BOSS GNU/Linux.

To install Java on BOSS GNU/Linux install sun-java6-jdk, BOSS 3.0 and above have sun-java6-jdk in the repositories so to install use Synaptic (to find out how to set up Synaptic on BOSS GNU/Linux click here).

Another option is to download the latest version of Oracle/ Sun JDK from here. You should download the .bin file, and then run it.  Be sure to set the environment variable JAVA_HOME. This can be done by appending the following to your .bashrc file:

JAVA_HOME=/path/to/jdk
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME

The .bashrc file can be found in your home directory and can easily be edited by typing

$nano ~/.bashrc

or

$gedit ~/.bashrc

after editing ~/.bashrc, open a new terminal window(or in the same terminal type source .bashrc) and type the following command:

$echo $JAVA_HOME

this should display the path you just set. Next type

$java -version

This will show you the version of jdk you just setup.

Once you are done installing JDK, you can now type your Java code on Gedit(its like notepad on steriods) and then compile and run them using javac/java from the shell.

For details on using IDEs like Eclipse or NetBeans on BOSS GNU/Linux click here.

Advertisements

One Response to Java programming on BOSS GNU/Linux

  1. manmath sahu says:

    i liked your tips and tricks…. but i’m sure like thousand other governmental projects it will remain orphan/ignored for ever. here are my thoughts:
    http://pclinuxos2007.blogspot.com/2010/06/boss-is-nobodys-boss.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: