Eager to Code, Enjoy to Debug ~ Embark into Each Stage with Your Heart

Installing Java on Ubuntu

Posted by: Chyne on: November 2, 2009

Some commands that you need to know during installing Java on Linux environment:

1) Get the installation package from this command:

sudo apt-get install sun-java-6-jdk

2) Check java version

java -version

3) Check location of installed jdk

sudo update-java-alternatives -l

4)Set default java

sudo update -java-alternatives -s java-6-sun

5) Set JAVA_HOME based on location

export JAVA_HOME=/usr/lib/jvm/java-6-sun

6) Set all the environment path in /etc/environment

JAVA_HOME=/usr/lib/jvm/java

7) Set in the /etc/bash.bashrc

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

8 ) Check the environment path

env|grep PATH

If possible, requires restart the pc.

Leave a Reply

Friday’s Java Snack


In Java, "thread" means:

  • An instance of class java.lang.Thread
  • A thread of execution


An instance of Thread is just an object that has variables and methods, and lives and dies on the heap.
 
A thread of execution is an individual process that has its own call stack (one thread per call stack).

 

November 2009
M T W T F S S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Archives


  • Faruk: its very very very fine solution perfect
  • blackhawk: Nice tip -- thanks for sharing
  • steven: -hlocalhost can be omitted for localhost

StatCounter

free hit counters