How to Install Sun Java on Ubuntu 10.04 LTS

Follow command lines:

  • sudo add-apt-repository “deb lucid partner” (Ubuntu official website provides these packages now)
  • sudo apt-get update
  • sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-plugin
  • sudo apt-get install sun-java6-jdk

If you already have openjdk installed, you might need extra steps to setup the default java

  • update-java-alternatives -l (list all available java)

for example, in my computer, I have both openjdk and sun:

java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun

set the default jdk to sun java

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



Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s