- Installing Java
- Type
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
. - Read and accept lisece of Sun.
- Now we should tell Ubuntu to regard the installed JVM as the default one:
- You need to edit a file called /etc/jvm. This file defines the default system JVM search order.
- The default system JVM is the first one available from top to bottom.
- Type
$ gksudo gedit /etc/jvm
so as to open it as root. - The file contains:
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr - Add
/usr/lib/jvm/java-6-sun
such that the file's contents become:/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr - Save and close the file.
- Testing Java
- Type
java -version
output should be something like:java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing) - Create a HelloWorld.java and save it in [certain_directory]
- Type
javac [certain_directory/HelloWorld.java]
- Nothing should be output.
- In the
the file "HelloWorld.class" must be generated. - Move the HelloWorld.class to [another_or_same_dir]
- Type
java -classpath [another_or_same_dir] HelloWorld
- Note that that we have set the environmental variable: classpath to avoid the ClassNotFoudException
- The HelloWorld.class must be executed (run) and
Hello World
is to be printed.
We have two options:
Version | Option 1 | Option 2 |
Eclipse version | Installing Eclipse Callisto (3.2) | Installing Eclipse Ganymede (3.4) |
Advantage | Enjoying the benefits of eclipse as a universe Ubuntu software package | Making use of eclipse latest version and its new features. |
Procedures |
|
|
Remember that -after migration to Ubuntu- you need to find a replacement to any platform dependent component like JDk, JRE, Eclipse and SWT (which is not the case of either any of nebula widgets as they are based upon SWT, nor Swing GUI library as it is based on JDK and JRE nor Java ribbon which based upon SWT).
I mean that all of those components will work fine on Ubuntu as well as any OS as long as the proper version of Java (JRE, JDK, JVM, SWT) is installed on the entire OS.
- From SWT home download SWT for linux
- Keep the downloaded zipped file in a known safe directory.
- Unzip it and copy the SWT.jar from it and paste in the directory of ur java project
- Refresh the project from eclipse and enjoy..