/[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.42 Revision 1.44
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.42 2008/09/28 20:29:25 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/java.xml,v 1.44 2009/10/07 18:14:31 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 link="/doc/en/java.xml">
6<title>Gentoo Java Guide</title> 6<title>Gentoo Java Guide</title>
7 7
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.17</version> 27<version>0.19</version>
28<date>2008-09-28</date> 28<date>2009-10-07</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>
124TODO: list free implementations? 124TODO: list free implementations?
125note about not drop-in replacements 125note about not drop-in replacements
126kaffe/sablevm/gcj/jamvm 126kaffe/sablevm/gcj/jamvm
127--> 127-->
128<p> 128<p>
129The default for Java 1.4 is the Blackdown JRE/JDK pair, as it is freely 129The default for Java 1.6 is the Sun JRE/JDK pair.
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> 130</p>
138 131
139</body> 132</body>
140</section> 133</section>
141<section> 134<section>
163<section> 156<section>
164<title>Installing fetch-restricted virtual machines</title> 157<title>Installing fetch-restricted virtual machines</title>
165<body> 158<body>
166 159
167<p> 160<p>
168As already mentioned, some of the JDKs and JREs require you to jump through a 161Some 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. 162installing. Simply emerge the packages as you normally would. The ebuilds will
170The ebuilds will then instruct you where to go and what to download. 163then instruct you where to go and what to download.
171</p> 164</p>
172 165
173<p> 166<p>
174You should download the indicated file(s) into 167You should download the indicated file(s) into
175<path>/usr/portage/distfiles</path>. Once there, you can rerun the emerge 168<path>/usr/portage/distfiles</path>. Once there, you can rerun the emerge
215</p> 208</p>
216 209
217<pre caption="Listing available VMs"> 210<pre caption="Listing available VMs">
218# <i>java-config --list-available-vms</i> 211# <i>java-config --list-available-vms</i>
219The following VMs are available for generation-2: 212The following VMs are available for generation-2:
2201) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2] 2131) 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] 2142) Blackdown JRE 1.4.2.03 [blackdown-jre-1.4.2] <comment>(Build Only)</comment>
2223) Blackdown 32bit JRE 1.4.2.03 [emul-linux-x86-java-1.4.2] 2153) IcedTea6-bin 1.4.1 [icedtea6-bin]
2234) Sun 32bit JRE 1.5.0.08 [emul-linux-x86-java-1.5] 2164) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment>
2245) Kaffe 1.1.7 [kaffe]
225*) Sun JDK 1.5.0.08 [sun-jdk-1.5] 217*) Sun JDK 1.6.0.16 [sun-jdk-1.6]
226</pre> 218</pre>
219
220<note>
221VMs marked as Build Only may contain security vulnerabilities and/or be EOL.
222Gentoo recommends not setting these VMs as either your system or user VM.
223Please see <uri link="java.xml#build-only">Build Only VM</uri> for more
224information.
225</note>
227 226
228<p> 227<p>
229The <e>*</e> indicates this is the current active vm (system-vm or user-vm when 228The <e>*</e> indicates this is the current active vm (system-vm or user-vm when
230set). The name in the brackets (<e>[]</e>) is the handle or ID for that 229set). The name in the brackets (<e>[]</e>) is the handle or ID for that
231particular VM. You use the handle or the number to <c>java-config 230particular VM. You use the handle or the number to <c>java-config
234 233
235<pre caption="Setting the System VM"> 234<pre caption="Setting the System VM">
236<comment>(By handle (preferred))</comment> 235<comment>(By handle (preferred))</comment>
237# <i>java-config --set-system-vm blackdown-jdk-1.4</i> 236# <i>java-config --set-system-vm blackdown-jdk-1.4</i>
238Now using blackdown-jdk-1.4 as your generation-2 system JVM 237Now using blackdown-jdk-1.4 as your generation-2 system JVM
238WARNING: blackdown-jdk-1.4 is marked as a build-only JVM. Using this vm is not recommended.
239<comment>(By number)</comment> 239<comment>(By number)</comment>
240# <i>java-config --set-system-vm 6</i> 240# <i>java-config --set-system-vm 5</i>
241Now using sun-jdk-1.5 as your generation-2 system JVM 241Now using sun-jdk-1.6 as your generation-2 system JVM
242</pre> 242</pre>
243 243
244<p> 244<p>
245As a regular user, you can use <c>java-config --set-user-vm</c>. 245As a regular user, you can use <c>java-config --set-user-vm</c>.
246</p> 246</p>
247 247
248<note> 248<note>
249You no longer have to <c>source</c> the profile for updates to the user/system 249You no longer have to <c>source</c> the profile for updates to the user/system
250VM take place. 250VM take place.
251</note> 251</note>
252
253</body>
254</section>
255<section id="build-only">
256<title>Build Only VM</title>
257<body>
258
259<p>
260Some virtual machines are flagged as build-only due to being EOL and/or
261containing security vulnerabilities. These virtual machines will not
262automatically be used by Gentoo for the running of applications using Gentoo
263launchers but will still be available for use by Gentoo's build environment as
264some packages may require them for building. The setting of these virtual
265machines as either your system or user VM is strongly discouraged as these VMs
266will then be used when running the <path>/usr/bin/{java,javac,..}</path>
267executables and will also be used by any packages not using Gentoo's launcher
268scripts.
269</p>
252 270
253</body> 271</body>
254</section> 272</section>
255<section id="preferred-vm"> 273<section id="preferred-vm">
256<title>Preferred VM</title> 274<title>Preferred VM</title>
485plugins by running: 503plugins by running:
486</p> 504</p>
487 505
488<pre caption="Viewing available plugins"> 506<pre caption="Viewing available plugins">
489# <i>eselect java-nsplugin list</i> 507# <i>eselect java-nsplugin list</i>
490 [1] sun-jre-bin-1.5 508 [1] sun-jre-bin-1.6
491 [2] blackdown-jre-1.4.2 509 [2] icedtea6-bin
492</pre> 510</pre>
493 511
494<p> 512<p>
495In this example, <c>sun-jre-bin</c> is selected for the browser plugin. 513In this example, <c>sun-jre-bin</c> is selected for the browser plugin.
496</p> 514</p>
497 515
498<pre caption="Selecting a plugin"> 516<pre caption="Selecting a plugin">
499# <i>eselect java-nsplugin set sun-jre-bin-1.5</i> 517# <i>eselect java-nsplugin set sun-jre-bin-1.6</i>
500</pre> 518</pre>
501 519
502<p> 520<p>
503Verify that the correct plugin was selected: 521Verify that the correct plugin was selected:
504</p> 522</p>
505 523
506<pre caption="Verifying the correct plugin"> 524<pre caption="Verifying the correct plugin">
507# <i>eselect java-nsplugin list</i> 525# <i>eselect java-nsplugin list</i>
508 [1] sun-jre-bin-1.5 current 526 [1] sun-jre-bin-1.6 current
509 [2] blackdown-jre-1.4.2 527 [2] icedtea6-bin
510</pre> 528</pre>
511 529
512<p> 530<p>
513Java.com also provides a link to <uri 531Java.com also provides a link to <uri
514link="http://java.com/en/download/installed.jsp">verify your installed 532link="http://java.com/en/download/installed.jsp">verify your installed
522<title>Plugins on multilib systems</title> 540<title>Plugins on multilib systems</title>
523<body> 541<body>
524 542
525<p> 543<p>
526If you are running a mixed 64-bit and 32-bit multilib system (for example, on 544If you are running a mixed 64-bit and 32-bit multilib system (for example, on
527AMD64), you can only use 32-bit Java plugins. 545AMD64), you can use 64-bit and 32-bit Java plugins. Unless you have a pressing
528</p> 546need to run 32-bit Java applications, we recommend using native 64-bit plugins
529 547on 64-bit web browsers.
530<p> 548</p>
531To use a 32-bit plugin, you will need to emerge <c>emul-linux-x86-java</c> with 549
550<p>
551There are several native 64-bit browser plugins available. The default JDK/JRE
552pair, <c>sun-jdk</c> and <c>sun-jre-bin</c>, both include browser plugins. Just
532the <c>nsplugin</c> USE flag enabled. 553emerge one of them with the <c>nsplugin</c> USE flag enabled.
554</p>
555
556<pre caption="Installing a 64-bit plugin">
557# <i>echo "dev-java/sun-jre-bin nsplugin" >> /etc/portage/package.use</i>
558# <i>emerge sun-jre-bin</i>
559</pre>
560
561<p>
562To use a 32-bit plugin on a 32-bit browser, you will need to emerge
563<c>emul-linux-x86-java</c> with the <c>nsplugin</c> USE flag enabled.
533</p> 564</p>
534 565
535<pre caption="Installing a 32-bit plugin"> 566<pre caption="Installing a 32-bit plugin">
536# <i>echo "app-emulation/emul-linux-x86-java nsplugin" >> /etc/portage/package.use</i> 567# <i>echo "app-emulation/emul-linux-x86-java nsplugin" >> /etc/portage/package.use</i>
537# <i>emerge emul-linux-x86-java</i> 568# <i>emerge emul-linux-x86-java</i>
542</p> 573</p>
543 574
544<pre caption="Viewing available plugins"> 575<pre caption="Viewing available plugins">
545# <i>eselect java-nsplugin list</i> 576# <i>eselect java-nsplugin list</i>
546Available 32-bit Java browser plugins 577Available 32-bit Java browser plugins
547 [1] emul-linux-x86-java-1.4.2
548 [2] emul-linux-x86-java-1.5 578 [1] emul-linux-x86-java-1.5
579 [2] emul-linux-x86-java-1.6
580Available 64-bit Java browser plugins
581 [1] icedtea6-bin
582 [2] sun-jre-bin-1.6
549</pre> 583</pre>
550 584
551<p>
552Although you must select a 32-bit browser (such as <c>mozilla-firefox-bin</c>)
553to use with your 32-bit plugin, the 64-bit version of <c>konqueror</c> uses your
554Java VM directly, so it's possible to use the 64-bit version of <c>blackdown</c>
555with this browser; no further configuration is necessary.
556</p> 585<p>
557
558<p>
559Now select the right plugin for your 32-bit browser: 586Now select the right plugin for your browsers:
560</p> 587</p>
561 588
562<pre caption="Selecting plugins"> 589<pre caption="Selecting plugins">
590<comment>(Choose the plugins for 32-bit and 64-bit browsers)</comment>
563# <i>eselect java-nsplugin set 32bit emul-linux-x86-java-1.5</i> 591# <i>eselect java-nsplugin set 32bit emul-linux-x86-java-1.6</i>
592# <i>eselect java-nsplugin set 64bit sun-jre-bin-1.6</i>
564</pre> 593</pre>
565 594
566<p> 595<p>
567Verify the correct plugin was selected: 596Verify the correct plugin was selected:
568</p> 597</p>
569 598
570<pre caption="Verifying the correct plugin"> 599<pre caption="Verifying the correct plugin">
571# <i>eselect java-nsplugin list</i> 600# <i>eselect java-nsplugin list</i>
572Available 32-bit Java browser plugins 601Available 32-bit Java browser plugins
573 [1] emul-linux-x86-java-1.4.2 602 [1] emul-linux-x86-java-1.5
574 [2] emul-linux-x86-java-1.5 current 603 [2] emul-linux-x86-java-1.6 current
604Available 64-bit Java browser plugins
605 [1] icedtea6-bin
606 [2] sun-jre-bin-1.6 current
575</pre> 607</pre>
576 608
577</body> 609</body>
578</section> 610</section>
579</chapter> 611</chapter>

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.44

  ViewVC Help
Powered by ViewVC 1.1.20