Thursday, June 28, 2012

How to set JAVA_HOME environment variable in Ubuntu


One way that you can set your JAVA_HOME variable and add to your PATH, is be doing the folowing.

As 'sudo' open up /etc/bash.bashrc and add the following to the end of the file. 

NOTE: Set the java path to whatever the actual path is on your environment if it does not match /usr/lib/jvm/java

 

    JAVA_HOME=/usr/lib/jvm/java
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

 

When you reboot, try running the following:

 

    $ echo $JAVA_HOME
/usr/lib/jvm/java
echo $PATH
[probably lots of paths]:/usr/lib/jvm/java/bin


Thursday, June 7, 2012

Installation of Open Java in ubuntu

Introduction

Java is a technology from Oracle (formerly: Sun Microsystems). There are several implementations, of which five will be discussed here:

  • OpenJDK: The primary goal of the OpenJDK project is to produce an open-source implementation of the Java SE Platform (6 and 7). This is the default version of Java that Ubuntu uses and is the easiest to install.

  • Oracle (Sun) Java 6: Oracle (Sun) Java 6 is the reference implementation for Java 6.

  • Oracle Java 7: Oracle Java 7 is the reference implementation for Java 7.

  • IBM Java: IBM Java is the preferred Java solution on PowerPC machines. It is a reimplementation with a Just-In-Time Compiler. It is only available from IBM's website.

  • GNU Compiler: A Java compiler made by GNU. Only developers should have to install this.

OpenJDK

Installation of Java Runtime Environment

  • Install the openjdk-6-jre package using any installation method.

  • Install the openjdk-7-jre package using any installation method.

Browser plugin

This plugin works with the main browsers: Firefox, Chromium, Google Chrome, and Epiphany.

On Konqueror, go to Settings → Configure Konqueror... and from menu select Java & JavaScript, then tick Enable Java globally option.

SDK (Software Development Kit)

  • Install the openjdk-6-jdk package using any installation method.

  • Install the openjdk-7-jdk package using any installation method.

Source: https://help.ubuntu.com/community/Java