/[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.51
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.51 2011/05/09 21:36:03 nightmorph 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>2</version>
28<date>2009-12-23</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>
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
110 <ti>dev-java/ibm-jre-bin</ti> 84 <ti>dev-java/ibm-jre-bin</ti>
111</tr> 85</tr>
112<tr> 86<tr>
113 <ti>BEA WebLogic's J2SE Development Kit</ti> 87 <ti>BEA WebLogic's J2SE Development Kit</ti>
114 <ti>dev-java/jrockit-jdk-bin</ti> 88 <ti>dev-java/jrockit-jdk-bin</ti>
89</tr>
90<tr>
91 <ti>The IcedTea Open Java Kit</ti>
92 <ti>dev-java/icedtea6-bin</ti>
115</tr> 93</tr>
116</table> 94</table>
117 95
118<!-- 96<!--
119TODO: list free implementations? 97TODO: list free implementations?
130To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>. 108To 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>. 109Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>.
132</p> 110</p>
133 111
134<p> 112<p>
135In recent events, Sun has relicensed their JDK and JRE under a more Linux 113Some 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 114License Agreement, or EULA. If its license (such as dlj-1.1) is not listed in
137freely downloadable, without any further hassle. 115ACCEPT_LICENSE in <path>/etc/make.conf</path>, then you won't be able to install
116the JDK/JRE. For more information on how to add acceptable licenses to
117<path>make.conf</path>, please read the <uri
118link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=1#doc_chap4">Portage
119Handbook</uri>.
120</p>
121
122<p>
123To avoid any restrictive license hassle, consider installing
124<c>icedtea6-bin</c>, which is an open Java implementation from the OpenJDK
125project.
138</p> 126</p>
139 127
140<note> 128<note>
141A JDK also includes a JRE, so if you install a JDK you shouldn't have to also 129A JDK also includes a JRE, so if you install a JDK you shouldn't have to also
142have to install a JRE. 130have to install a JRE.
257</p> 245</p>
258 246
259</body> 247</body>
260</section> 248</section>
261<section id="preferred-vm"> 249<section id="preferred-vm">
262<title>Preferred VM</title> 250<title>Preferred Build VM</title>
263<body> 251<body>
264 252
265<p>
266While merging Java packages, the VM can and will be switched as necessary.
267</p> 253<p>
268 254While merging Java packages, the VM used for building can sometimes be different
255from the one currently set as the system VM.
269<p> 256</p>
270Because of the wide variety of available VMs, we do not have the resources to 257
271test and verify every package works on all of them. So to ensure that every 258<p>
272packages merges smoothly, we have defined a list of <e>default/supported 259This merge time VM switching is needed when, for example, your system-vm is
260set to a 1.6 VM and the package you are merging requires a 1.5 VM. While merging
261it will select and use a 1.5 VM, leaving your system-vm choice intact.
262</p>
263
264<p>
265To 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 266VMs</e> per arch. You can find them in
274<path>/usr/share/java-config-2/config/jdk-defaults.conf</path>. When you are 267<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> 268</p>
280The merge time VM switching is also needed when, for example, your system-vm is 269
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> 270<p>
284 271You 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 272<path>/etc/java-config-2/build/jdk.conf</path> and have complete control over
288which VM will get used. Some examples: 273which VM will get used for merging. Some examples:
289</p> 274</p>
290 275
291<pre caption="Example /etc/java-config-2/build/jdk.conf"> 276<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> 277<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 278*=sun-jdk
3051.5=sun-jdk 2901.5=sun-jdk
306</pre> 291</pre>
307 292
308<warn> 293<warn>
309You do not <e>have</e> to edit this file. If you change these options to use a 294You 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 295unsupported VM, things could possibly break. Because of the wide variety of
296available VMs, we do not have the resources to test and verify every package
297works 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. 298as much as bugs present within supported VMs.
312</warn> 299</warn>
313 300
314</body> 301</body>
315</section> 302</section>
316</chapter> 303</chapter>
319<title>Compilers</title> 306<title>Compilers</title>
320<section> 307<section>
321<body> 308<body>
322 309
323<p> 310<p>
324The standard Java compiler used for building is javac, which comes with each 311The 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 312each 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 313possible configure which compiler is used. Essentially, you define a list your
327preference for which compiler to use in 314preference for which compiler to use in
328<path>/etc/java-config-2/build/compilers.conf</path>. 315<path>/etc/java-config-2/build/compilers.conf</path>.
329</p> 316</p>
330 317
331<pre caption="/etc/java-config-2/build/compilers.conf"> 318<pre caption="/etc/java-config-2/build/compilers.conf">

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

  ViewVC Help
Powered by ViewVC 1.1.20