/[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.39 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.39 2007/04/29 02:36:16 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.15</version> 27<version>0.19</version>
28<date>2007-04-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>
113 <ti>The IBM Java Kit</ti> 113 <ti>The IBM Java Kit</ti>
114 <ti>dev-java/ibm-jdk-bin</ti> 114 <ti>dev-java/ibm-jdk-bin</ti>
115 <ti>dev-java/ibm-jre-bin</ti> 115 <ti>dev-java/ibm-jre-bin</ti>
116</tr> 116</tr>
117<tr> 117<tr>
118 <ti>The Compaq Java Kit for Alpha/Linux/GNU</ti>
119 <ti>dev-java/compaq-jdk</ti>
120 <ti>dev-java/compaq-jre</ti>
121</tr>
122<tr>
123 <ti>BEA WebLogic's J2SE Development Kit</ti> 118 <ti>BEA WebLogic's J2SE Development Kit</ti>
124 <ti>dev-java/jrockit-jdk-bin</ti> 119 <ti>dev-java/jrockit-jdk-bin</ti>
125</tr> 120</tr>
126</table> 121</table>
127 122
128<!-- 123<!--
129TODO: list free implementations? 124TODO: list free implementations?
130note about not drop-in replacements 125note about not drop-in replacements
131kaffe/sablevm/gcj/jamvm 126kaffe/sablevm/gcj/jamvm
132--> 127-->
133<p> 128<p>
134The 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.
135("free as in beer") available without any registration fuss.
136</p>
137
138<p>
139JREs and JDKs from Sun, IBM, and BEA are generally faster, but getting them
140is a bit more work, as you are required to read and accept their license before
141downloading (IBM additionally requires you to register).
142</p> 130</p>
143 131
144</body> 132</body>
145</section> 133</section>
146<section> 134<section>
168<section> 156<section>
169<title>Installing fetch-restricted virtual machines</title> 157<title>Installing fetch-restricted virtual machines</title>
170<body> 158<body>
171 159
172<p> 160<p>
173As 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
174few hoops before installing. Simply emerge the packages as you normally would. 162installing. Simply emerge the packages as you normally would. The ebuilds will
175The ebuilds will then instruct you where to go and what to download. 163then instruct you where to go and what to download.
176</p> 164</p>
177 165
178<p> 166<p>
179You should download the indicated file(s) into 167You should download the indicated file(s) into
180<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
220</p> 208</p>
221 209
222<pre caption="Listing available VMs"> 210<pre caption="Listing available VMs">
223# <i>java-config --list-available-vms</i> 211# <i>java-config --list-available-vms</i>
224The following VMs are available for generation-2: 212The following VMs are available for generation-2:
2251) 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>
2262) 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>
2273) Blackdown 32bit JRE 1.4.2.03 [emul-linux-x86-java-1.4.2] 2153) IcedTea6-bin 1.4.1 [icedtea6-bin]
2284) 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>
2295) Kaffe 1.1.7 [kaffe]
230*) Sun JDK 1.5.0.08 [sun-jdk-1.5] 217*) Sun JDK 1.6.0.16 [sun-jdk-1.6]
231</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>
232 226
233<p> 227<p>
234The <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
235set). 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
236particular 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
239 233
240<pre caption="Setting the System VM"> 234<pre caption="Setting the System VM">
241<comment>(By handle (preferred))</comment> 235<comment>(By handle (preferred))</comment>
242# <i>java-config --set-system-vm blackdown-jdk-1.4</i> 236# <i>java-config --set-system-vm blackdown-jdk-1.4</i>
243Now 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.
244<comment>(By number)</comment> 239<comment>(By number)</comment>
245# <i>java-config --set-system-vm 6</i> 240# <i>java-config --set-system-vm 5</i>
246Now using sun-jdk-1.5 as your generation-2 system JVM 241Now using sun-jdk-1.6 as your generation-2 system JVM
247</pre> 242</pre>
248 243
249<p> 244<p>
250As 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>.
251</p> 246</p>
252 247
253<note> 248<note>
254You 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
255VM take place. 250VM take place.
256</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>
257 270
258</body> 271</body>
259</section> 272</section>
260<section id="preferred-vm"> 273<section id="preferred-vm">
261<title>Preferred VM</title> 274<title>Preferred VM</title>
442</p> 455</p>
443 456
444<p> 457<p>
445For users, <c>java-config --set-user-classpath</c> will create 458For users, <c>java-config --set-user-classpath</c> will create
446<path>~/.gentoo/java-env-classpath</path>, which you should then source from 459<path>~/.gentoo/java-env-classpath</path>, which you should then source from
447your shell's profile. 460your shell's profile.
448</p> 461</p>
449 462
450<pre caption="Sourcing user specific classpath"> 463<pre caption="Sourcing user specific classpath">
451<i>if [[ -f "${HOME}/.gentoo/java-env-classpath" ]]; then 464<i>if [[ -f "${HOME}/.gentoo/java-env-classpath" ]]; then
452 source ${HOME}/.gentoo/java-env-classpath 465 source ${HOME}/.gentoo/java-env-classpath
458something like the following to your shell's profile. But we would advise 471something like the following to your shell's profile. But we would advise
459against it. 472against it.
460</p> 473</p>
461 474
462<pre caption="Setting classpath"> 475<pre caption="Setting classpath">
463# <i>export CLASSPATH="${CLASSPATH}:$(java-config --classpath log4j,xerces-2)"</i> 476# <i>export CLASSPATH="${CLASSPATH}:$(java-config --classpath log4j,xerces-2)"</i>
464</pre> 477</pre>
465 478
466</body> 479</body>
467</section> 480</section>
468</chapter> 481</chapter>
490plugins by running: 503plugins by running:
491</p> 504</p>
492 505
493<pre caption="Viewing available plugins"> 506<pre caption="Viewing available plugins">
494# <i>eselect java-nsplugin list</i> 507# <i>eselect java-nsplugin list</i>
495 [1] sun-jre-bin-1.5 508 [1] sun-jre-bin-1.6
496 [2] blackdown-jre-1.4.2 509 [2] icedtea6-bin
497</pre> 510</pre>
498 511
499<p> 512<p>
500In 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.
501</p> 514</p>
502 515
503<pre caption="Selecting a plugin"> 516<pre caption="Selecting a plugin">
504# <i>eselect java-nsplugin set sun-jre-bin-1.5</i> 517# <i>eselect java-nsplugin set sun-jre-bin-1.6</i>
505</pre> 518</pre>
506 519
507<p> 520<p>
508Verify that the correct plugin was selected: 521Verify that the correct plugin was selected:
509</p> 522</p>
510 523
511<pre caption="Verifying the correct plugin"> 524<pre caption="Verifying the correct plugin">
512# <i>eselect java-nsplugin list</i> 525# <i>eselect java-nsplugin list</i>
513 [1] sun-jre-bin-1.5 current 526 [1] sun-jre-bin-1.6 current
514 [2] blackdown-jre-1.4.2 527 [2] icedtea6-bin
515</pre> 528</pre>
516 529
517<p> 530<p>
518Java.com also provides a link to <uri 531Java.com also provides a link to <uri
519link="http://java.com/en/download/installed.jsp">verify your installed 532link="http://java.com/en/download/installed.jsp">verify your installed
526<section> 539<section>
527<title>Plugins on multilib systems</title> 540<title>Plugins on multilib systems</title>
528<body> 541<body>
529 542
530<p> 543<p>
531If you are running a mixed 64-bit and 32-bit multilib system (for example, on AMD64), 544If you are running a mixed 64-bit and 32-bit multilib system (for example, on
532you can only use 32-bit Java plugins. 545AMD64), you can use 64-bit and 32-bit Java plugins. Unless you have a pressing
533</p> 546need to run 32-bit Java applications, we recommend using native 64-bit plugins
534 547on 64-bit web browsers.
535<p> 548</p>
536To 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
537the <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.
538</p> 564</p>
539 565
540<pre caption="Installing a 32-bit plugin"> 566<pre caption="Installing a 32-bit plugin">
541# <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>
542# <i>emerge emul-linux-x86-java</i> 568# <i>emerge emul-linux-x86-java</i>
547</p> 573</p>
548 574
549<pre caption="Viewing available plugins"> 575<pre caption="Viewing available plugins">
550# <i>eselect java-nsplugin list</i> 576# <i>eselect java-nsplugin list</i>
551Available 32-bit Java browser plugins 577Available 32-bit Java browser plugins
552 [1] emul-linux-x86-java-1.4.2
553 [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
554</pre> 583</pre>
555 584
556<p>
557Although you must select a 32-bit browser (such as <c>mozilla-firefox-bin</c>)
558to use with your 32-bit plugin, the 64-bit version of <c>konqueror</c> uses your
559Java VM directly, so it's possible to use the 64-bit version of <c>blackdown</c>
560with this browser; no further configuration is necessary.
561</p> 585<p>
562
563<p>
564Now select the right plugin for your 32-bit browser: 586Now select the right plugin for your browsers:
565</p> 587</p>
566 588
567<pre caption="Selecting plugins"> 589<pre caption="Selecting plugins">
590<comment>(Choose the plugins for 32-bit and 64-bit browsers)</comment>
568# <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>
569</pre> 593</pre>
570 594
571<p> 595<p>
572Verify the correct plugin was selected: 596Verify the correct plugin was selected:
573</p> 597</p>
574 598
575<pre caption="Verifying the correct plugin"> 599<pre caption="Verifying the correct plugin">
576# <i>eselect java-nsplugin list</i> 600# <i>eselect java-nsplugin list</i>
577Available 32-bit Java browser plugins 601Available 32-bit Java browser plugins
578 [1] emul-linux-x86-java-1.4.2 602 [1] emul-linux-x86-java-1.5
579 [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
580</pre> 607</pre>
581 608
582</body> 609</body>
583</section> 610</section>
584</chapter> 611</chapter>
611 <li> 638 <li>
612 The <b>source</b> flag installs a zip of the source code of a package. 639 The <b>source</b> flag installs a zip of the source code of a package.
613 This is traditionally used for IDEs to 'attach' source to the libraries you 640 This is traditionally used for IDEs to 'attach' source to the libraries you
614 are using. 641 are using.
615 </li> 642 </li>
643 <li>The <b>jce</b> flag adds support for the Java Cryptography Engine</li>
616 <li> 644 <li>
617 For Java packages, the <b>doc</b> flag will build API documentation using 645 For Java packages, the <b>doc</b> flag will build API documentation using
618 javadoc. 646 javadoc.
619 </li> 647 </li>
620</ul> 648</ul>
652 link="http://news.gmane.org/gmane.linux.gentoo.user">gentoo-user</uri>, and 680 link="http://news.gmane.org/gmane.linux.gentoo.user">gentoo-user</uri>, and
653 <uri 681 <uri
654 link="http://news.gmane.org/gmane.linux.gentoo.devel">gentoo-dev</uri> 682 link="http://news.gmane.org/gmane.linux.gentoo.devel">gentoo-dev</uri>
655 mailing list archives 683 mailing list archives
656 </li> 684 </li>
657 <li>#gentoo and #gentoo-java on irc.freenode.net</li> 685 <li>
686 <uri link="irc://irc.gentoo.org/gentoo">#gentoo</uri> and <uri
687 link="irc://irc.gentoo.org/gentoo-java">#gentoo-java</uri> on IRC
688 </li>
658 <li> 689 <li>
659 <uri 690 <uri
660 link="http://en.wikipedia.org/wiki/Java_programming_language">Wikipedia's 691 link="http://en.wikipedia.org/wiki/Java_programming_language">Wikipedia's
661 entry for Java</uri> 692 entry for Java</uri>
662 </li> 693 </li>
694 <li>
695 If you have suggestions or questions regarding this document, please email
696 the Gentoo Java team: <mail>java@gentoo.org</mail>
697 </li>
663</ul> 698</ul>
664 699
665</body> 700</body>
666</section> 701</section>
667</chapter> 702</chapter>

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

  ViewVC Help
Powered by ViewVC 1.1.20