| 1 | <?xml version="1.0" encoding="UTF-8"?> |
1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/java.xml,v 1.44 2009/10/07 18:14:31 nightmorph Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/java.xml,v 1.48 2010/03/31 23:38:40 nightmorph Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | |
4 | |
| 5 | <guide link="/doc/en/java.xml"> |
5 | <guide> |
| 6 | <title>Gentoo Java Guide</title> |
6 | <title>Gentoo Java Guide</title> |
| 7 | |
7 | |
| 8 | <author title="Author"> |
8 | <author title="Author"> |
| 9 | <mail link="nichoj@gentoo.org">Joshua Nichols</mail> |
9 | <mail link="nichoj@gentoo.org">Joshua Nichols</mail> |
| 10 | </author> |
10 | </author> |
| … | |
… | |
| 22 | |
22 | |
| 23 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
23 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 24 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
24 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 25 | <license/> |
25 | <license/> |
| 26 | |
26 | |
| 27 | <version>0.19</version> |
27 | <version>0.22</version> |
| 28 | <date>2009-10-07</date> |
28 | <date>2009-12-23</date> |
| 29 | |
29 | |
| 30 | <chapter> |
30 | <chapter> |
| 31 | <title>What is Java?</title> |
31 | <title>What is Java?</title> |
| 32 | <section> |
32 | <section> |
| 33 | <title>Overview</title> |
33 | <title>Overview</title> |
| … | |
… | |
| 98 | <th>Vendor</th> |
98 | <th>Vendor</th> |
| 99 | <th>JDK</th> |
99 | <th>JDK</th> |
| 100 | <th>JRE</th> |
100 | <th>JRE</th> |
| 101 | </tr> |
101 | </tr> |
| 102 | <tr> |
102 | <tr> |
| 103 | <ti>The Blackdown Java Kit</ti> |
|
|
| 104 | <ti>dev-java/blackdown-jdk</ti> |
|
|
| 105 | <ti>dev-java/blackdown-jre</ti> |
|
|
| 106 | </tr> |
|
|
| 107 | <tr> |
|
|
| 108 | <ti>Sun's Java Kit</ti> |
103 | <ti>Sun's Java Kit</ti> |
| 109 | <ti>dev-java/sun-jdk</ti> |
104 | <ti>dev-java/sun-jdk</ti> |
| 110 | <ti>dev-java/sun-jre-bin</ti> |
105 | <ti>dev-java/sun-jre-bin</ti> |
| 111 | </tr> |
106 | </tr> |
| 112 | <tr> |
107 | <tr> |
| … | |
… | |
| 123 | <!-- |
118 | <!-- |
| 124 | TODO: list free implementations? |
119 | TODO: list free implementations? |
| 125 | note about not drop-in replacements |
120 | note about not drop-in replacements |
| 126 | kaffe/sablevm/gcj/jamvm |
121 | kaffe/sablevm/gcj/jamvm |
| 127 | --> |
122 | --> |
| 128 | <p> |
|
|
| 129 | The default for Java 1.6 is the Sun JRE/JDK pair. |
|
|
| 130 | </p> |
|
|
| 131 | |
|
|
| 132 | </body> |
123 | </body> |
| 133 | </section> |
124 | </section> |
| 134 | <section> |
125 | <section> |
| 135 | <title>Installing a JRE/JDKs</title> |
126 | <title>Installing a JRE/JDKs</title> |
| 136 | <body> |
127 | <body> |
| … | |
… | |
| 140 | Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. |
131 | Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. |
| 141 | </p> |
132 | </p> |
| 142 | |
133 | |
| 143 | <p> |
134 | <p> |
| 144 | In recent events, Sun has relicensed their JDK and JRE under a more Linux |
135 | In recent events, Sun has relicensed their JDK and JRE under a more Linux |
| 145 | distro friendly license. As a result, Sun releases Java 1.5 and onwards are |
136 | distro friendly license. As a result, Sun Java 1.5 and onwards are |
| 146 | freely downloadable, without any further hassle. |
137 | freely downloadable, without any further hassle. |
| 147 | </p> |
138 | </p> |
| 148 | |
139 | |
| 149 | <note> |
140 | <note> |
| 150 | A JDK also includes a JRE, so if you install a JDK you shouldn't have to also |
141 | A JDK also includes a JRE, so if you install a JDK you shouldn't have to also |
| … | |
… | |
| 208 | </p> |
199 | </p> |
| 209 | |
200 | |
| 210 | <pre caption="Listing available VMs"> |
201 | <pre caption="Listing available VMs"> |
| 211 | # <i>java-config --list-available-vms</i> |
202 | # <i>java-config --list-available-vms</i> |
| 212 | The following VMs are available for generation-2: |
203 | The following VMs are available for generation-2: |
| 213 | 1) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2] <comment>(Build Only)</comment> |
|
|
| 214 | 2) Blackdown JRE 1.4.2.03 [blackdown-jre-1.4.2] <comment>(Build Only)</comment> |
|
|
| 215 | 3) IcedTea6-bin 1.4.1 [icedtea6-bin] |
204 | 1) IcedTea6-bin 1.4.1 [icedtea6-bin] |
| 216 | 4) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment> |
205 | 2) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment> |
| 217 | *) Sun JDK 1.6.0.16 [sun-jdk-1.6] |
206 | *) Sun JDK 1.6.0.16 [sun-jdk-1.6] |
| 218 | </pre> |
207 | </pre> |
| 219 | |
208 | |
| 220 | <note> |
209 | <note> |
| 221 | VMs marked as Build Only may contain security vulnerabilities and/or be EOL. |
210 | VMs marked as Build Only may contain security vulnerabilities and/or be EOL. |
| … | |
… | |
| 231 | --set-system-vm</c>. Here is an example of how to set the system VM. |
220 | --set-system-vm</c>. Here is an example of how to set the system VM. |
| 232 | </p> |
221 | </p> |
| 233 | |
222 | |
| 234 | <pre caption="Setting the System VM"> |
223 | <pre caption="Setting the System VM"> |
| 235 | <comment>(By handle (preferred))</comment> |
224 | <comment>(By handle (preferred))</comment> |
| 236 | # <i>java-config --set-system-vm blackdown-jdk-1.4</i> |
225 | # <i>java-config --set-system-vm sun-jdk-1.6</i> |
| 237 | Now using blackdown-jdk-1.4 as your generation-2 system JVM |
226 | Now using sun-jdk-1.6 as your generation-2 system JVM |
| 238 | WARNING: blackdown-jdk-1.4 is marked as a build-only JVM. Using this vm is not recommended. |
|
|
| 239 | <comment>(By number)</comment> |
227 | <comment>(By number)</comment> |
| 240 | # <i>java-config --set-system-vm 5</i> |
228 | # <i>java-config --set-system-vm 3</i> |
| 241 | Now using sun-jdk-1.6 as your generation-2 system JVM |
229 | Now using sun-jdk-1.6 as your generation-2 system JVM |
| 242 | </pre> |
230 | </pre> |
| 243 | |
231 | |
| 244 | <p> |
232 | <p> |
| 245 | As a regular user, you can use <c>java-config --set-user-vm</c>. |
233 | As a regular user, you can use <c>java-config --set-user-vm</c>. |
| … | |
… | |
| 310 | *=sun-jdk-1.5 |
298 | *=sun-jdk-1.5 |
| 311 | </pre> |
299 | </pre> |
| 312 | |
300 | |
| 313 | <pre caption="Example /etc/java-config-2/build/jdk.conf"> |
301 | <pre caption="Example /etc/java-config-2/build/jdk.conf"> |
| 314 | <comment># For 1.3 I prefer sun-jdk 1.4 but when it is not available, use ibm-jdk-bin, |
302 | <comment># For 1.3 I prefer sun-jdk 1.4 but when it is not available, use ibm-jdk-bin, |
| 315 | # For 1.4, use blackdown-jdk, and for 1.5, use sun-jdk </comment> |
303 | # For 1.5, use sun-jdk </comment> |
| 316 | 1.3=sun-jdk-1.4 ibm-jdk-bin |
304 | 1.3=sun-jdk-1.4 ibm-jdk-bin |
| 317 | 1.4=blackdown-jdk |
|
|
| 318 | 1.5=sun-jdk |
305 | 1.5=sun-jdk |
| 319 | </pre> |
306 | </pre> |
| 320 | |
307 | |
| 321 | <warn> |
308 | <warn> |
| 322 | You do not have to edit this file. If you change these options to use a |
309 | You do not <e>have</e> to edit this file. If you change these options to use a |
| 323 | unsupported VM, things could possibly break. Bugs reported with a unsupported |
310 | unsupported VM, things could possibly break. Bugs reported with a unsupported VM |
| 324 | VM won't be prioritized as much as bugs present within supported VMs. |
311 | won't be prioritized as much as bugs present within supported VMs. |
| 325 | </warn> |
312 | </warn> |
| 326 | |
313 | |
| 327 | </body> |
314 | </body> |
| 328 | </section> |
315 | </section> |
| 329 | </chapter> |
316 | </chapter> |
| … | |
… | |
| 344 | <pre caption="/etc/java-config-2/build/compilers.conf"> |
331 | <pre caption="/etc/java-config-2/build/compilers.conf"> |
| 345 | # If the ebuild supports it |
332 | # If the ebuild supports it |
| 346 | # it will check the COMPILERS var front to back and |
333 | # it will check the COMPILERS var front to back and |
| 347 | # use the first compiler that is installed |
334 | # use the first compiler that is installed |
| 348 | |
335 | |
| 349 | COMPILERS="ecj-3.1 jikes javac" |
336 | COMPILERS="ecj-X.Y jikes javac" |
| 350 | </pre> |
337 | </pre> |
| 351 | |
338 | |
| 352 | <p> |
339 | <p> |
| 353 | Some compilers don't support all possible -target and -source arguments. |
340 | Some compilers don't support all possible -target and -source arguments. |
| 354 | Therefore, each compiler in the list is checked to see if it can support the |
341 | Therefore, each compiler in the list is checked to see if it can support the |
| … | |
… | |
| 386 | 1.5 syntax yet. |
373 | 1.5 syntax yet. |
| 387 | </ti> |
374 | </ti> |
| 388 | </tr> |
375 | </tr> |
| 389 | <tr> |
376 | <tr> |
| 390 | <ti>Eclipse Compiler for Java</ti> |
377 | <ti>Eclipse Compiler for Java</ti> |
| 391 | <ti>ecj-3.1</ti> |
378 | <ti>ecj</ti> |
| 392 | <ti>=dev-java/eclipse-ecj-3.1*</ti> |
379 | <ti>dev-java/eclipse-ecj</ti> |
| 393 | <ti> |
380 | <ti> |
| 394 | ECJ is the compiler used by the Eclipse software development kit. It is |
381 | ECJ is the compiler used by the Eclipse software development kit. It is |
| 395 | very full featured, and is pretty fast. It does support Java 1.5 syntax. |
382 | very full featured, and is pretty fast. It does support Java 1.5 syntax. |
| 396 | </ti> |
383 | </ti> |
| 397 | </tr> |
384 | </tr> |