Java is one of the most popular programming language and its popularity has undergone an exponential growth (probably because it’s well suitable in distributed environment – you can use Java to develop cool web application with a lot of complex features as well as in developing sophisticated desktop applications, and it’s platform independent – ‘write once and run everywhere‘) in fast few years.
Similarly Ubuntu (latest version : Ubuntu 11.10 beta 1) has become the most popular Linux distro – for desktop environment. That’s why, Ubuntu is now considered as a great platform for developing Java applications.
Anyway, if you are an Ubuntu user and going to start learning Java or a java programmer/developer – want to start coding on Ubuntu, this post is about installing Java Development Kit (JDK) on Ubuntu 11.10 (although it is expected to work on other Debian based Linux distro too). On the other hand if you’re an Ubuntu user, interested only in running java applications then you don’t need to install jdk (it has lot of components which is not required for executing a java program/software) – instead you just need to install jre on Ubuntu 11.10 i.e java runtime environment (includes Java Virtual Machine, for executing java bytecode/class).
Installing Java Development Kit (JDK) on Ubuntu
There’re many JDK available thesedays. One of the most popular – open source jdk is openjdk. OpenJDK is well compatible with Ubuntu/Linux and it is available in official repository – so you can install it a click.
install openjdk on Ubuntu 11.10
Open a terminal (Ctrl+Alt+t) and execute the command(s) –
sudo apt-get install openjdk-7-jdk
OR you can install sunjdk
Update1 : The sun jdk isn’t included with the official repository, so you first need to add a PPA for that; Thanks to Casier :).
sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jdk sun-java6-plugin
That’s All..have fun in programming in Java, with Ubuntu!