/[gentoo]/xml/htdocs/doc/en/java.xml
Gentoo

Diff of /xml/htdocs/doc/en/java.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.43 Revision 1.48
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.43 2009/09/16 15:26:43 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.18</version> 27<version>0.22</version>
28<date>2009-09-16</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<!--
124TODO: list free implementations? 119TODO: list free implementations?
125note about not drop-in replacements 120note about not drop-in replacements
126kaffe/sablevm/gcj/jamvm 121kaffe/sablevm/gcj/jamvm
127--> 122-->
128<p>
129The default for Java 1.4 is the Blackdown JRE/JDK pair, as it is freely
130("free as in beer") available without any registration fuss.
131</p>
132
133<p>
134JREs and JDKs from Sun, IBM, and BEA are generally faster, but getting them
135is a bit more work, as you are required to read and accept their license before
136downloading (IBM additionally requires you to register).
137</p>
138
139</body> 123</body>
140</section> 124</section>
141<section> 125<section>
142<title>Installing a JRE/JDKs</title> 126<title>Installing a JRE/JDKs</title>
143<body> 127<body>
147Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. 131Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>.
148</p> 132</p>
149 133
150<p> 134<p>
151In recent events, Sun has relicensed their JDK and JRE under a more Linux 135In recent events, Sun has relicensed their JDK and JRE under a more Linux
152distro friendly license. As a result, Sun releases Java 1.5 and onwards are 136distro friendly license. As a result, Sun Java 1.5 and onwards are
153freely downloadable, without any further hassle. 137freely downloadable, without any further hassle.
154</p> 138</p>
155 139
156<note> 140<note>
157A JDK also includes a JRE, so if you install a JDK you shouldn't have to also 141A JDK also includes a JRE, so if you install a JDK you shouldn't have to also
163<section> 147<section>
164<title>Installing fetch-restricted virtual machines</title> 148<title>Installing fetch-restricted virtual machines</title>
165<body> 149<body>
166 150
167<p> 151<p>
168As already mentioned, some of the JDKs and JREs require you to jump through a 152Some of the JDKs and JREs require you to jump through a few hoops before
169few hoops before installing. Simply emerge the packages as you normally would. 153installing. Simply emerge the packages as you normally would. The ebuilds will
170The ebuilds will then instruct you where to go and what to download. 154then instruct you where to go and what to download.
171</p> 155</p>
172 156
173<p> 157<p>
174You should download the indicated file(s) into 158You should download the indicated file(s) into
175<path>/usr/portage/distfiles</path>. Once there, you can rerun the emerge 159<path>/usr/portage/distfiles</path>. Once there, you can rerun the emerge
215</p> 199</p>
216 200
217<pre caption="Listing available VMs"> 201<pre caption="Listing available VMs">
218# <i>java-config --list-available-vms</i> 202# <i>java-config --list-available-vms</i>
219The following VMs are available for generation-2: 203The following VMs are available for generation-2:
2201) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2] <comment>(Build Only)</comment>
2212) Blackdown JRE 1.4.2.03 [blackdown-jre-1.4.2] <comment>(Build Only)</comment>
2223) IcedTea6-bin 1.4.1 [icedtea6-bin] 2041) IcedTea6-bin 1.4.1 [icedtea6-bin]
2234) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment> 2052) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment>
224*) Sun JDK 1.6.0.16 [sun-jdk-1.6] 206*) Sun JDK 1.6.0.16 [sun-jdk-1.6]
225</pre> 207</pre>
226 208
227<note> 209<note>
228VMs marked as Build Only may contain security vulnerabilities and/or be EOL. 210VMs marked as Build Only may contain security vulnerabilities and/or be EOL.
238--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.
239</p> 221</p>
240 222
241<pre caption="Setting the System VM"> 223<pre caption="Setting the System VM">
242<comment>(By handle (preferred))</comment> 224<comment>(By handle (preferred))</comment>
243# <i>java-config --set-system-vm blackdown-jdk-1.4</i> 225# <i>java-config --set-system-vm sun-jdk-1.6</i>
244Now using blackdown-jdk-1.4 as your generation-2 system JVM 226Now using sun-jdk-1.6 as your generation-2 system JVM
245WARNING: blackdown-jdk-1.4 is marked as a build-only JVM. Using this vm is not recommended.
246<comment>(By number)</comment> 227<comment>(By number)</comment>
247# <i>java-config --set-system-vm 5</i> 228# <i>java-config --set-system-vm 3</i>
248Now using sun-jdk-1.6 as your generation-2 system JVM 229Now using sun-jdk-1.6 as your generation-2 system JVM
249</pre> 230</pre>
250 231
251<p> 232<p>
252As a regular user, you can use <c>java-config --set-user-vm</c>. 233As a regular user, you can use <c>java-config --set-user-vm</c>.
317*=sun-jdk-1.5 298*=sun-jdk-1.5
318</pre> 299</pre>
319 300
320<pre caption="Example /etc/java-config-2/build/jdk.conf"> 301<pre caption="Example /etc/java-config-2/build/jdk.conf">
321<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,
322# For 1.4, use blackdown-jdk, and for 1.5, use sun-jdk </comment> 303# For 1.5, use sun-jdk </comment>
3231.3=sun-jdk-1.4 ibm-jdk-bin 3041.3=sun-jdk-1.4 ibm-jdk-bin
3241.4=blackdown-jdk
3251.5=sun-jdk 3051.5=sun-jdk
326</pre> 306</pre>
327 307
328<warn> 308<warn>
329You do not have to edit this file. If you change these options to use a 309You do not <e>have</e> to edit this file. If you change these options to use a
330unsupported VM, things could possibly break. Bugs reported with a unsupported 310unsupported VM, things could possibly break. Bugs reported with a unsupported VM
331VM won't be prioritized as much as bugs present within supported VMs. 311won't be prioritized as much as bugs present within supported VMs.
332</warn> 312</warn>
333 313
334</body> 314</body>
335</section> 315</section>
336</chapter> 316</chapter>
351<pre caption="/etc/java-config-2/build/compilers.conf"> 331<pre caption="/etc/java-config-2/build/compilers.conf">
352# If the ebuild supports it 332# If the ebuild supports it
353# it will check the COMPILERS var front to back and 333# it will check the COMPILERS var front to back and
354# use the first compiler that is installed 334# use the first compiler that is installed
355 335
356COMPILERS="ecj-3.1 jikes javac" 336COMPILERS="ecj-X.Y jikes javac"
357</pre> 337</pre>
358 338
359<p> 339<p>
360Some compilers don't support all possible -target and -source arguments. 340Some compilers don't support all possible -target and -source arguments.
361Therefore, each compiler in the list is checked to see if it can support the 341Therefore, each compiler in the list is checked to see if it can support the
393 1.5 syntax yet. 373 1.5 syntax yet.
394 </ti> 374 </ti>
395</tr> 375</tr>
396<tr> 376<tr>
397 <ti>Eclipse Compiler for Java</ti> 377 <ti>Eclipse Compiler for Java</ti>
398 <ti>ecj-3.1</ti> 378 <ti>ecj</ti>
399 <ti>=dev-java/eclipse-ecj-3.1*</ti> 379 <ti>dev-java/eclipse-ecj</ti>
400 <ti> 380 <ti>
401 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
402 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.
403 </ti> 383 </ti>
404</tr> 384</tr>
510plugins by running: 490plugins by running:
511</p> 491</p>
512 492
513<pre caption="Viewing available plugins"> 493<pre caption="Viewing available plugins">
514# <i>eselect java-nsplugin list</i> 494# <i>eselect java-nsplugin list</i>
515 [1] sun-jre-bin-1.5 495 [1] sun-jre-bin-1.6
516 [2] blackdown-jre-1.4.2 496 [2] icedtea6-bin
517</pre> 497</pre>
518 498
519<p> 499<p>
520In this example, <c>sun-jre-bin</c> is selected for the browser plugin. 500In this example, <c>sun-jre-bin</c> is selected for the browser plugin.
521</p> 501</p>
522 502
523<pre caption="Selecting a plugin"> 503<pre caption="Selecting a plugin">
524# <i>eselect java-nsplugin set sun-jre-bin-1.5</i> 504# <i>eselect java-nsplugin set sun-jre-bin-1.6</i>
525</pre> 505</pre>
526 506
527<p> 507<p>
528Verify that the correct plugin was selected: 508Verify that the correct plugin was selected:
529</p> 509</p>
530 510
531<pre caption="Verifying the correct plugin"> 511<pre caption="Verifying the correct plugin">
532# <i>eselect java-nsplugin list</i> 512# <i>eselect java-nsplugin list</i>
533 [1] sun-jre-bin-1.5 current 513 [1] sun-jre-bin-1.6 current
534 [2] blackdown-jre-1.4.2 514 [2] icedtea6-bin
535</pre> 515</pre>
536 516
537<p> 517<p>
538Java.com also provides a link to <uri 518Java.com also provides a link to <uri
539link="http://java.com/en/download/installed.jsp">verify your installed 519link="http://java.com/en/download/installed.jsp">verify your installed
547<title>Plugins on multilib systems</title> 527<title>Plugins on multilib systems</title>
548<body> 528<body>
549 529
550<p> 530<p>
551If you are running a mixed 64-bit and 32-bit multilib system (for example, on 531If you are running a mixed 64-bit and 32-bit multilib system (for example, on
552AMD64), you can only use 32-bit Java plugins. 532AMD64), you can use 64-bit and 32-bit Java plugins. Unless you have a pressing
553</p> 533need to run 32-bit Java applications, we recommend using native 64-bit plugins
554 534on 64-bit web browsers.
555<p> 535</p>
556To use a 32-bit plugin, you will need to emerge <c>emul-linux-x86-java</c> with 536
537<p>
538There are several native 64-bit browser plugins available. The default JDK/JRE
539pair, <c>sun-jdk</c> and <c>sun-jre-bin</c>, both include browser plugins. Just
557the <c>nsplugin</c> USE flag enabled. 540emerge one of them with the <c>nsplugin</c> USE flag enabled.
541</p>
542
543<pre caption="Installing a 64-bit plugin">
544# <i>echo "dev-java/sun-jre-bin nsplugin" >> /etc/portage/package.use</i>
545# <i>emerge sun-jre-bin</i>
546</pre>
547
548<p>
549To use a 32-bit plugin on a 32-bit browser, you will need to emerge
550<c>emul-linux-x86-java</c> with the <c>nsplugin</c> USE flag enabled.
558</p> 551</p>
559 552
560<pre caption="Installing a 32-bit plugin"> 553<pre caption="Installing a 32-bit plugin">
561# <i>echo "app-emulation/emul-linux-x86-java nsplugin" >> /etc/portage/package.use</i> 554# <i>echo "app-emulation/emul-linux-x86-java nsplugin" >> /etc/portage/package.use</i>
562# <i>emerge emul-linux-x86-java</i> 555# <i>emerge emul-linux-x86-java</i>
567</p> 560</p>
568 561
569<pre caption="Viewing available plugins"> 562<pre caption="Viewing available plugins">
570# <i>eselect java-nsplugin list</i> 563# <i>eselect java-nsplugin list</i>
571Available 32-bit Java browser plugins 564Available 32-bit Java browser plugins
572 [1] emul-linux-x86-java-1.4.2
573 [2] emul-linux-x86-java-1.5 565 [1] emul-linux-x86-java-1.5
566 [2] emul-linux-x86-java-1.6
567Available 64-bit Java browser plugins
568 [1] icedtea6-bin
569 [2] sun-jre-bin-1.6
574</pre> 570</pre>
575 571
576<p>
577Although you must select a 32-bit browser (such as <c>mozilla-firefox-bin</c>)
578to use with your 32-bit plugin, the 64-bit version of <c>konqueror</c> uses your
579Java VM directly, so it's possible to use the 64-bit version of <c>blackdown</c>
580with this browser; no further configuration is necessary.
581</p> 572<p>
582
583<p>
584Now select the right plugin for your 32-bit browser: 573Now select the right plugin for your browsers:
585</p> 574</p>
586 575
587<pre caption="Selecting plugins"> 576<pre caption="Selecting plugins">
577<comment>(Choose the plugins for 32-bit and 64-bit browsers)</comment>
588# <i>eselect java-nsplugin set 32bit emul-linux-x86-java-1.5</i> 578# <i>eselect java-nsplugin set 32bit emul-linux-x86-java-1.6</i>
579# <i>eselect java-nsplugin set 64bit sun-jre-bin-1.6</i>
589</pre> 580</pre>
590 581
591<p> 582<p>
592Verify the correct plugin was selected: 583Verify the correct plugin was selected:
593</p> 584</p>
594 585
595<pre caption="Verifying the correct plugin"> 586<pre caption="Verifying the correct plugin">
596# <i>eselect java-nsplugin list</i> 587# <i>eselect java-nsplugin list</i>
597Available 32-bit Java browser plugins 588Available 32-bit Java browser plugins
598 [1] emul-linux-x86-java-1.4.2 589 [1] emul-linux-x86-java-1.5
599 [2] emul-linux-x86-java-1.5 current 590 [2] emul-linux-x86-java-1.6 current
591Available 64-bit Java browser plugins
592 [1] icedtea6-bin
593 [2] sun-jre-bin-1.6 current
600</pre> 594</pre>
601 595
602</body> 596</body>
603</section> 597</section>
604</chapter> 598</chapter>

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.48

  ViewVC Help
Powered by ViewVC 1.1.20