version 5 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
BenStaz |
1 |
JDK is the Java Development Kit, A software development package from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets. |
|
|
2 |
|
|
|
3 |
!!Ubuntu Edgy 6.10 |
|
|
4 |
|
|
|
5 |
First we make sure that the backport repository is available in our sources.list |
|
|
6 |
|
|
|
7 |
Use your favourite text editor to open up the sources.list. |
|
|
8 |
|
|
|
9 |
*sudo vim /etc/apt/sources.list |
|
|
10 |
|
|
|
11 |
Make sure the following two lines are not commented out (Commented out means that the line begins with a '#' character): |
|
|
12 |
|
2 |
BenStaz |
13 |
<verbatim> |
1 |
BenStaz |
14 |
deb http://nz.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse |
|
|
15 |
deb-src http://nz.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse |
3 |
BenStaz |
16 |
</verbatim> |
|
|
17 |
|
|
|
18 |
If you also would like to install the [Eclipse] IDE, then make sure the universe repository is available on the sources.list file. |
|
|
19 |
|
|
|
20 |
<verbatim> |
|
|
21 |
deb http://nz.archive.ubuntu.com/ubuntu/ edgy universe |
|
|
22 |
deb-src http://nz.archive.ubuntu.com/ubuntu/ edgy universe |
2 |
BenStaz |
23 |
</verbatim> |
1 |
BenStaz |
24 |
|
|
|
25 |
Save the sources.list. |
|
|
26 |
|
|
|
27 |
Now we need to update our list of available packages from the apt sources. |
|
|
28 |
|
|
|
29 |
*sudo aptitude update |
|
|
30 |
|
|
|
31 |
Now we download and install Java 1.6. |
|
|
32 |
|
|
|
33 |
*sudo aptitude install sun-java6-jdk |
|
|
34 |
|
|
|
35 |
There is a fair bit to download so hopefully you are no longer using dial-up :) |
|
|
36 |
A few license agreements will pop-up, just choose OK. |
|
|
37 |
|
|
|
38 |
Now that is done we need to make sure that we are using the correct version of java. |
|
|
39 |
|
|
|
40 |
*sudo update-alternatives --config java |
|
|
41 |
|
|
|
42 |
You will see a few alternatives. Select the option that has ''java-6-sun'' in the java path. |
|
|
43 |
|
|
|
44 |
Now we will do the same thing for the compiler: |
|
|
45 |
|
|
|
46 |
*sudo update-alternatives --config javac |
|
|
47 |
|
|
|
48 |
Once again select the alternative with ''java-6-sun'' in the path. |
3 |
BenStaz |
49 |
|
|
|
50 |
!For those who wish to use the [Eclipse] IDE. |
|
|
51 |
|
|
|
52 |
*sudo aptitude install eclipse |
5 |
BenStaz |
53 |
|
|
|
54 |
Start up eclipse with the command |
|
|
55 |
|
|
|
56 |
*eclipse & |
|
|
57 |
|
|
|
58 |
Head to your workbench and then ''File --> New --> Project'' |
|
|
59 |
Choose ''java project''. and click next. |
|
|
60 |
|
|
|
61 |
!In the ''JRE'' section, if your default is not set at ''java-6-sun-1.6.0.00'' |
|
|
62 |
Click ''configure JREs'' |
|
|
63 |
Click the add button and browse to ''/usr/lib/jvm'' |
|
|
64 |
Choose ''java-6-sun-1.6.0.00'' (There may be some other symbolic links you can choose also) and click OK. |
|
|
65 |
Make sure that java-6-sun-1.6.0.00 has a tick next to it. |
|
|
66 |
|
|
|
67 |
Good now we will set up the JDK compliance Level. |
|
|
68 |
Click the dropdown box next to the text ''compiler compliance level'' and choose 6.0. |
|
|
69 |
Click OK. |
2 |
BenStaz |
70 |
|
|
|
71 |
You should be all ready to start coding in java! |