/[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.44 Revision 1.50
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 $ -->
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.50 2011/05/09 19:16:31 nightmorph Exp $ -->
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>1</version>
28<date>2009-10-07</date> 28<date>2011-05-09</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>
115 <ti>dev-java/ibm-jre-bin</ti> 110 <ti>dev-java/ibm-jre-bin</ti>
116</tr> 111</tr>
117<tr> 112<tr>
118 <ti>BEA WebLogic's J2SE Development Kit</ti> 113 <ti>BEA WebLogic's J2SE Development Kit</ti>
119 <ti>dev-java/jrockit-jdk-bin</ti> 114 <ti>dev-java/jrockit-jdk-bin</ti>
115</tr>
116<tr>
117 <ti>The IcedTea Open Java Kit</ti>
118 <ti>dev-java/icedtea</ti>
119 <ti>dev-java/icedtea6-bin</ti>
120</tr> 120</tr>
121</table> 121</table>
122 122
123<!-- 123<!--
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>
129The default for Java 1.6 is the Sun JRE/JDK pair.
130</p>
131
132</body> 128</body>
133</section> 129</section>
134<section> 130<section>
135<title>Installing a JRE/JDKs</title> 131<title>Installing a JRE/JDKs</title>
136<body> 132<body>
139To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>. 135To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>.
140Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. 136Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>.
141</p> 137</p>
142 138
143<p> 139<p>
144In recent events, Sun has relicensed their JDK and JRE under a more Linux 140Some JDKs and JREs, including the Sun packages, require accepting an End User
145distro friendly license. As a result, Sun releases Java 1.5 and onwards are 141License Agreement, or EULA. If its license (such as dlj-1.1) is not listed in
146freely downloadable, without any further hassle. 142ACCEPT_LICENSE in <path>/etc/make.conf</path>, then you won't be able to install
143the JDK/JRE. For more information on how to add acceptable licenses to
144<path>make.conf</path>, please read the <uri
145link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=1#doc_chap4">Portage
146Handbook</uri>.
147</p>
148
149<p>
150To avoid any restrictive license hassle, consider installing <c>icedtea6-bin</c>
151or <c>icedtea</c>, which are more open Java implementations from the OpenJDK
152project.
147</p> 153</p>
148 154
149<note> 155<note>
150A JDK also includes a JRE, so if you install a JDK you shouldn't have to also 156A JDK also includes a JRE, so if you install a JDK you shouldn't have to also
151have to install a JRE. 157have to install a JRE.
208</p> 214</p>
209 215
210<pre caption="Listing available VMs"> 216<pre caption="Listing available VMs">
211# <i>java-config --list-available-vms</i> 217# <i>java-config --list-available-vms</i>
212The following VMs are available for generation-2: 218The following VMs are available for generation-2:
2131) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2] <comment>(Build Only)</comment>
2142) Blackdown JRE 1.4.2.03 [blackdown-jre-1.4.2] <comment>(Build Only)</comment>
2153) IcedTea6-bin 1.4.1 [icedtea6-bin] 2191) IcedTea6-bin 1.4.1 [icedtea6-bin]
2164) Sun JDK 1.5.0.20 [sun-jdk-1.5] <comment>(Build Only)</comment> 2202) 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] 221*) Sun JDK 1.6.0.16 [sun-jdk-1.6]
218</pre> 222</pre>
219 223
220<note> 224<note>
221VMs marked as Build Only may contain security vulnerabilities and/or be EOL. 225VMs 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. 235--set-system-vm</c>. Here is an example of how to set the system VM.
232</p> 236</p>
233 237
234<pre caption="Setting the System VM"> 238<pre caption="Setting the System VM">
235<comment>(By handle (preferred))</comment> 239<comment>(By handle (preferred))</comment>
236# <i>java-config --set-system-vm blackdown-jdk-1.4</i> 240# <i>java-config --set-system-vm sun-jdk-1.6</i>
237Now using blackdown-jdk-1.4 as your generation-2 system JVM 241Now using sun-jdk-1.6 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> 242<comment>(By number)</comment>
240# <i>java-config --set-system-vm 5</i> 243# <i>java-config --set-system-vm 3</i>
241Now using sun-jdk-1.6 as your generation-2 system JVM 244Now using sun-jdk-1.6 as your generation-2 system JVM
242</pre> 245</pre>
243 246
244<p> 247<p>
245As a regular user, you can use <c>java-config --set-user-vm</c>. 248As a regular user, you can use <c>java-config --set-user-vm</c>.
269</p> 272</p>
270 273
271</body> 274</body>
272</section> 275</section>
273<section id="preferred-vm"> 276<section id="preferred-vm">
274<title>Preferred VM</title> 277<title>Preferred Build VM</title>
275<body> 278<body>
276 279
277<p>
278While merging Java packages, the VM can and will be switched as necessary.
279</p> 280<p>
280 281While merging Java packages, the VM used for building can sometimes be different
282from the one currently set as the system VM.
281<p> 283</p>
282Because of the wide variety of available VMs, we do not have the resources to 284
283test and verify every package works on all of them. So to ensure that every 285<p>
284packages merges smoothly, we have defined a list of <e>default/supported 286This merge time VM switching is needed when, for example, your system-vm is
287set to a 1.6 VM and the package you are merging requires a 1.5 VM. While merging
288it will select and use a 1.5 VM, leaving your system-vm choice intact.
289</p>
290
291<p>
292To define which VM is selected when a switch is needed, we have created a list of <e>default/supported
285VMs</e> per arch. You can find them in 293VMs</e> per arch. You can find them in
286<path>/usr/share/java-config-2/config/jdk-defaults.conf</path>. When you are 294<path>/usr/share/java-config-2/config/jdk-defaults.conf</path>.
287merging a Java package, and it detects one of the VM in that file is installed,
288it will automatically use that VM, instead of the system-vm.
289</p>
290
291<p> 295</p>
292The merge time VM switching is also needed when, for example, your system-vm is 296
293set a 1.4 VM and the package you are merging requires a 1.5 VM. While merging
294it will use the preferred 1.5 VM, leaving your system-vm choice intact.
295</p> 297<p>
296 298You can override these defaults (and even your selected system VM) in
297<p>
298Of course, Gentoo is all about choice, so you can override these defaults in
299<path>/etc/java-config-2/build/jdk.conf</path> and have complete control over 299<path>/etc/java-config-2/build/jdk.conf</path> and have complete control over
300which VM will get used. Some examples: 300which VM will get used for merging. Some examples:
301</p> 301</p>
302 302
303<pre caption="Example /etc/java-config-2/build/jdk.conf"> 303<pre caption="Example /etc/java-config-2/build/jdk.conf">
304<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> 304<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>
305*=sun-jdk 305*=sun-jdk
310*=sun-jdk-1.5 310*=sun-jdk-1.5
311</pre> 311</pre>
312 312
313<pre caption="Example /etc/java-config-2/build/jdk.conf"> 313<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, 314<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> 315# For 1.5, use sun-jdk </comment>
3161.3=sun-jdk-1.4 ibm-jdk-bin 3161.3=sun-jdk-1.4 ibm-jdk-bin
3171.4=blackdown-jdk
3181.5=sun-jdk 3171.5=sun-jdk
319</pre> 318</pre>
320 319
321<warn> 320<warn>
322You do not have to edit this file. If you change these options to use a 321You do not <e>have</e> to edit this file. If you change these options to use a
323unsupported VM, things could possibly break. Bugs reported with a unsupported 322unsupported VM, things could possibly break. Because of the wide variety of
323available VMs, we do not have the resources to test and verify every package
324works on all of them. Bugs reported with a unsupported VM won't be prioritized
324VM won't be prioritized as much as bugs present within supported VMs. 325as much as bugs present within supported VMs.
325</warn> 326</warn>
326 327
327</body> 328</body>
328</section> 329</section>
329</chapter> 330</chapter>
332<title>Compilers</title> 333<title>Compilers</title>
333<section> 334<section>
334<body> 335<body>
335 336
336<p> 337<p>
337The standard Java compiler used for building is javac, which comes with each 338The standard Java compiler used for building is <c>javac</c>, which comes with
338JDK. In addition to configuring the VM used at build time, it is also possible 339each JDK. In addition to configuring the VM used at build time, it is also
339configure which compiler is used. Essentially, you define a list your 340possible configure which compiler is used. Essentially, you define a list your
340preference for which compiler to use in 341preference for which compiler to use in
341<path>/etc/java-config-2/build/compilers.conf</path>. 342<path>/etc/java-config-2/build/compilers.conf</path>.
342</p> 343</p>
343 344
344<pre caption="/etc/java-config-2/build/compilers.conf"> 345<pre caption="/etc/java-config-2/build/compilers.conf">
345# If the ebuild supports it 346# If the ebuild supports it
346# it will check the COMPILERS var front to back and 347# it will check the COMPILERS var front to back and
347# use the first compiler that is installed 348# use the first compiler that is installed
348 349
349COMPILERS="ecj-3.1 jikes javac" 350COMPILERS="ecj-X.Y jikes javac"
350</pre> 351</pre>
351 352
352<p> 353<p>
353Some compilers don't support all possible -target and -source arguments. 354Some compilers don't support all possible -target and -source arguments.
354Therefore, each compiler in the list is checked to see if it can support the 355Therefore, each compiler in the list is checked to see if it can support the
386 1.5 syntax yet. 387 1.5 syntax yet.
387 </ti> 388 </ti>
388</tr> 389</tr>
389<tr> 390<tr>
390 <ti>Eclipse Compiler for Java</ti> 391 <ti>Eclipse Compiler for Java</ti>
391 <ti>ecj-3.1</ti> 392 <ti>ecj</ti>
392 <ti>=dev-java/eclipse-ecj-3.1*</ti> 393 <ti>dev-java/eclipse-ecj</ti>
393 <ti> 394 <ti>
394 ECJ is the compiler used by the Eclipse software development kit. It is 395 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. 396 very full featured, and is pretty fast. It does support Java 1.5 syntax.
396 </ti> 397 </ti>
397</tr> 398</tr>

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

  ViewVC Help
Powered by ViewVC 1.1.20