/[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.48 Revision 1.54
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.48 2010/03/31 23:38:40 nightmorph Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/java.xml,v 1.54 2012/07/24 12:12:51 swift Exp $ -->
4 4
5<guide> 5<guide>
6<title>Gentoo Java Guide</title> 6<title>Gentoo Java Guide</title>
7 7
8<author title="Author"> 8<author title="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.22</version> 27<version>5</version>
28<date>2009-12-23</date> 28<date>2012-07-24</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>
55</body> 55</body>
56</section> 56</section>
57</chapter> 57</chapter>
58 58
59<chapter> 59<chapter>
60<title>Before You Begin</title>
61<section>
62<title>Existing installs</title>
63<body>
64
65<p>
66For existing installs, regardless of if you have installed anything Java
67before, make sure you have followed the <uri
68link="/proj/en/java/java-upgrade.xml">Java Upgrade Guide</uri>.
69</p>
70
71</body>
72</section>
73<section>
74<title>New installs</title>
75<body>
76
77<p>
78New installs should require no further preparation.
79</p>
80
81</body>
82</section>
83</chapter>
84
85<chapter>
86<title>Installing a Virtual Machine</title> 60<title>Installing a Virtual Machine</title>
87<section> 61<section>
88<title>The choices</title> 62<title>The choices</title>
89<body> 63<body>
90 64
98 <th>Vendor</th> 72 <th>Vendor</th>
99 <th>JDK</th> 73 <th>JDK</th>
100 <th>JRE</th> 74 <th>JRE</th>
101</tr> 75</tr>
102<tr> 76<tr>
77 <ti>The IcedTea Open Java SE (formerly icedtea6-bin)</ti>
78 <ti>dev-java/icedtea-bin</ti>
79 <ti />
80</tr>
81<tr>
82 <ti>Oracle's Java 7 SE</ti>
83 <ti>dev-java/oracle-jdk-bin</ti>
84 <ti>dev-java/oracle-jre-bin</ti>
85</tr>
86<tr>
103 <ti>Sun's Java Kit</ti> 87 <ti>Sun's Java 6 SE</ti>
104 <ti>dev-java/sun-jdk</ti> 88 <ti>dev-java/sun-jdk</ti>
105 <ti>dev-java/sun-jre-bin</ti> 89 <ti>dev-java/sun-jre-bin</ti>
106</tr> 90</tr>
107<tr> 91<tr>
108 <ti>The IBM Java Kit</ti> 92 <ti>The IBM Java SE</ti>
109 <ti>dev-java/ibm-jdk-bin</ti> 93 <ti>dev-java/ibm-jdk-bin</ti>
110 <ti>dev-java/ibm-jre-bin</ti> 94 <ti>dev-java/ibm-jre-bin</ti>
111</tr>
112<tr>
113 <ti>BEA WebLogic's J2SE Development Kit</ti>
114 <ti>dev-java/jrockit-jdk-bin</ti>
115</tr> 95</tr>
116</table> 96</table>
117 97
118<!-- 98<!--
119TODO: list free implementations? 99TODO: list free implementations?
130To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>. 110To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>.
131Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. 111Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>.
132</p> 112</p>
133 113
134<p> 114<p>
135In recent events, Sun has relicensed their JDK and JRE under a more Linux 115Some JDKs and JREs, including the Sun packages, require accepting an End User
136distro friendly license. As a result, Sun Java 1.5 and onwards are 116License Agreement, or EULA. If its license (such as dlj-1.1) is not listed in
137freely downloadable, without any further hassle. 117ACCEPT_LICENSE in <path>/etc/portage/make.conf</path>, then you won't be able to install
118the JDK/JRE. For more information on how to add acceptable licenses to
119<path>make.conf</path>, please read the <uri
120link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=1#doc_chap4">Portage
121Handbook</uri>.
122</p>
123
124<p>
125To avoid any restrictive license hassle, consider installing
126<c>icedtea-bin</c>, which is an open Java implementation from the OpenJDK
127project.
138</p> 128</p>
139 129
140<note> 130<note>
141A JDK also includes a JRE, so if you install a JDK you shouldn't have to also 131A JDK also includes a JRE, so if you install a JDK you shouldn't have to also
142have to install a JRE. 132have to install a JRE.
199</p> 189</p>
200 190
201<pre caption="Listing available VMs"> 191<pre caption="Listing available VMs">
202# <i>java-config --list-available-vms</i> 192# <i>java-config --list-available-vms</i>
203The following VMs are available for generation-2: 193The following VMs are available for generation-2:
2041) IcedTea6-bin 1.4.1 [icedtea6-bin] 1941) IcedTea-bin 1.10.4 [icedtea-bin]
2052) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment> 1952) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment>
206*) Sun JDK 1.6.0.16 [sun-jdk-1.6] 196*) Sun JDK 1.6.0.16 [sun-jdk-1.6]
207</pre> 197</pre>
208 198
209<note> 199<note>
257</p> 247</p>
258 248
259</body> 249</body>
260</section> 250</section>
261<section id="preferred-vm"> 251<section id="preferred-vm">
262<title>Preferred VM</title> 252<title>Preferred Build VM</title>
263<body> 253<body>
264 254
265<p>
266While merging Java packages, the VM can and will be switched as necessary.
267</p> 255<p>
268 256While merging Java packages, the VM used for building can sometimes be different
257from the one currently set as the system VM.
269<p> 258</p>
270Because of the wide variety of available VMs, we do not have the resources to 259
271test and verify every package works on all of them. So to ensure that every 260<p>
272packages merges smoothly, we have defined a list of <e>default/supported 261This merge time VM switching is needed when, for example, your system-vm is
262set to a 1.6 VM and the package you are merging requires a 1.5 VM. While merging
263it will select and use a 1.5 VM, leaving your system-vm choice intact.
264</p>
265
266<p>
267To define which VM is selected when a switch is needed, we have created a list of <e>default/supported
273VMs</e> per arch. You can find them in 268VMs</e> per arch. You can find them in
274<path>/usr/share/java-config-2/config/jdk-defaults.conf</path>. When you are 269<path>/usr/share/java-config-2/config/jdk-defaults.conf</path>.
275merging a Java package, and it detects one of the VM in that file is installed,
276it will automatically use that VM, instead of the system-vm.
277</p>
278
279<p> 270</p>
280The merge time VM switching is also needed when, for example, your system-vm is 271
281set a 1.4 VM and the package you are merging requires a 1.5 VM. While merging
282it will use the preferred 1.5 VM, leaving your system-vm choice intact.
283</p> 272<p>
284 273You can override these defaults (and even your selected system VM) in
285<p>
286Of course, Gentoo is all about choice, so you can override these defaults in
287<path>/etc/java-config-2/build/jdk.conf</path> and have complete control over 274<path>/etc/java-config-2/build/jdk.conf</path> and have complete control over
288which VM will get used. Some examples: 275which VM will get used for merging. Some examples:
289</p> 276</p>
290 277
291<pre caption="Example /etc/java-config-2/build/jdk.conf"> 278<pre caption="Example /etc/java-config-2/build/jdk.conf">
292<comment>(I always want it to use a sun-jdk, ie sun-jdk-1.4 for 1.4, sun-jdk-1.5 for 1.5, etc)</comment> 279<comment>(I always want it to use a sun-jdk, ie sun-jdk-1.4 for 1.4, sun-jdk-1.5 for 1.5, etc)</comment>
293*=sun-jdk 280*=sun-jdk
3051.5=sun-jdk 2921.5=sun-jdk
306</pre> 293</pre>
307 294
308<warn> 295<warn>
309You do not <e>have</e> to edit this file. If you change these options to use a 296You do not <e>have</e> to edit this file. If you change these options to use a
310unsupported VM, things could possibly break. Bugs reported with a unsupported VM 297unsupported VM, things could possibly break. Because of the wide variety of
298available VMs, we do not have the resources to test and verify every package
299works on all of them. Bugs reported with a unsupported VM won't be prioritized
311won't be prioritized as much as bugs present within supported VMs. 300as much as bugs present within supported VMs.
312</warn> 301</warn>
313 302
314</body> 303</body>
315</section> 304</section>
316</chapter> 305</chapter>
319<title>Compilers</title> 308<title>Compilers</title>
320<section> 309<section>
321<body> 310<body>
322 311
323<p> 312<p>
324The standard Java compiler used for building is javac, which comes with each 313The standard Java compiler used for building is <c>javac</c>, which comes with
325JDK. In addition to configuring the VM used at build time, it is also possible 314each JDK. In addition to configuring the VM used at build time, it is also
326configure which compiler is used. Essentially, you define a list your 315possible configure which compiler is used. Essentially, you define a list your
327preference for which compiler to use in 316preference for which compiler to use in
328<path>/etc/java-config-2/build/compilers.conf</path>. 317<path>/etc/java-config-2/build/compilers.conf</path>.
329</p> 318</p>
330 319
331<pre caption="/etc/java-config-2/build/compilers.conf"> 320<pre caption="/etc/java-config-2/build/compilers.conf">
491</p> 480</p>
492 481
493<pre caption="Viewing available plugins"> 482<pre caption="Viewing available plugins">
494# <i>eselect java-nsplugin list</i> 483# <i>eselect java-nsplugin list</i>
495 [1] sun-jre-bin-1.6 484 [1] sun-jre-bin-1.6
496 [2] icedtea6-bin 485 [2] icedtea-bin
497</pre> 486</pre>
498 487
499<p> 488<p>
500In this example, <c>sun-jre-bin</c> is selected for the browser plugin. 489In this example, <c>sun-jre-bin</c> is selected for the browser plugin.
501</p> 490</p>
509</p> 498</p>
510 499
511<pre caption="Verifying the correct plugin"> 500<pre caption="Verifying the correct plugin">
512# <i>eselect java-nsplugin list</i> 501# <i>eselect java-nsplugin list</i>
513 [1] sun-jre-bin-1.6 current 502 [1] sun-jre-bin-1.6 current
514 [2] icedtea6-bin 503 [2] icedtea-bin
515</pre> 504</pre>
516 505
517<p> 506<p>
518Java.com also provides a link to <uri 507Java.com also provides a link to <uri
519link="http://java.com/en/download/installed.jsp">verify your installed 508link="http://java.com/en/download/installed.jsp">verify your installed
563# <i>eselect java-nsplugin list</i> 552# <i>eselect java-nsplugin list</i>
564Available 32-bit Java browser plugins 553Available 32-bit Java browser plugins
565 [1] emul-linux-x86-java-1.5 554 [1] emul-linux-x86-java-1.5
566 [2] emul-linux-x86-java-1.6 555 [2] emul-linux-x86-java-1.6
567Available 64-bit Java browser plugins 556Available 64-bit Java browser plugins
568 [1] icedtea6-bin 557 [1] icedtea-bin
569 [2] sun-jre-bin-1.6 558 [2] sun-jre-bin-1.6
570</pre> 559</pre>
571 560
572<p> 561<p>
573Now select the right plugin for your browsers: 562Now select the right plugin for your browsers:
587# <i>eselect java-nsplugin list</i> 576# <i>eselect java-nsplugin list</i>
588Available 32-bit Java browser plugins 577Available 32-bit Java browser plugins
589 [1] emul-linux-x86-java-1.5 578 [1] emul-linux-x86-java-1.5
590 [2] emul-linux-x86-java-1.6 current 579 [2] emul-linux-x86-java-1.6 current
591Available 64-bit Java browser plugins 580Available 64-bit Java browser plugins
592 [1] icedtea6-bin 581 [1] icedtea-bin
593 [2] sun-jre-bin-1.6 current 582 [2] sun-jre-bin-1.6 current
594</pre> 583</pre>
595 584
596</body> 585</body>
597</section> 586</section>

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

  ViewVC Help
Powered by ViewVC 1.1.20