Sunday, November 11, 2007

Setting up Java Development Environment on Ubuntu Gutsy, Part 1

Setting the Java Development Environment on Ubuntu Linux is quite a straightforward process, you just need a little knowledge with working with the Terminal (as I prefer it, much faster), here we go:
  1. Open the terminal, update your local software list by typing "sudo apt-get update", I use the keyword sudo here to have administrative privileges of the "root" user which is needed to run many commands among which is "apt-get" (Note: pressing tab once in the terminal will auto-complete your command and double tabbing lists all available names starting with the letters you already typed)
  2. Type "sudo apt-get install sun-java6-jdk", and by the way, if you need the Java plugin for firefox as well, you can type "sudo apt-get install sun-java6-jdk sun-java6-plugin" which is unfortunately not yet available for the 64-bit Linux platforms :(
  3. Dependencies between packages will be automatically resolved by the apt-get command and installation will start after your confirmation (Note: you can accept the license agreement in the terminal by simply pressing the right arrow button and then pressing Enter, took me a lot of time to figure that out :D)
  4. After installation is complete, check you have the correct Java version by typing "java -version" in case you have multiple JDKs.
  5. If you still haven't got the right JDK as your default, simply use the "update-java-alternatives -l" command to list the available JDKs on your system and then choose the one you need by typing "update-java-alternatives -s JDKname", we're done! Simple, isn't it?

No comments: