| 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.50 2011/05/09 19:16:31 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>1</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> |
| … | |
… | |
| 111 | </tr> |
111 | </tr> |
| 112 | <tr> |
112 | <tr> |
| 113 | <ti>BEA WebLogic's J2SE Development Kit</ti> |
113 | <ti>BEA WebLogic's J2SE Development Kit</ti> |
| 114 | <ti>dev-java/jrockit-jdk-bin</ti> |
114 | <ti>dev-java/jrockit-jdk-bin</ti> |
| 115 | </tr> |
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> |
| 116 | </table> |
121 | </table> |
| 117 | |
122 | |
| 118 | <!-- |
123 | <!-- |
| 119 | TODO: list free implementations? |
124 | TODO: list free implementations? |
| 120 | note about not drop-in replacements |
125 | note about not drop-in replacements |
| … | |
… | |
| 130 | To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>. |
135 | To install your profile's default JDK, you can run <c>emerge virtual/jdk</c>. |
| 131 | Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. |
136 | Or to install your profile's default JRE, you can <c>emerge virtual/jre</c>. |
| 132 | </p> |
137 | </p> |
| 133 | |
138 | |
| 134 | <p> |
139 | <p> |
| 135 | In recent events, Sun has relicensed their JDK and JRE under a more Linux |
140 | Some JDKs and JREs, including the Sun packages, require accepting an End User |
| 136 | distro friendly license. As a result, Sun Java 1.5 and onwards are |
141 | License Agreement, or EULA. If its license (such as dlj-1.1) is not listed in |
| 137 | freely downloadable, without any further hassle. |
142 | ACCEPT_LICENSE in <path>/etc/make.conf</path>, then you won't be able to install |
|
|
143 | the JDK/JRE. For more information on how to add acceptable licenses to |
|
|
144 | <path>make.conf</path>, please read the <uri |
|
|
145 | link="/doc/en/handbook/handbook-x86.xml?part=2&chap=1#doc_chap4">Portage |
|
|
146 | Handbook</uri>. |
|
|
147 | </p> |
|
|
148 | |
|
|
149 | <p> |
|
|
150 | To avoid any restrictive license hassle, consider installing <c>icedtea6-bin</c> |
|
|
151 | or <c>icedtea</c>, which are more open Java implementations from the OpenJDK |
|
|
152 | project. |
| 138 | </p> |
153 | </p> |
| 139 | |
154 | |
| 140 | <note> |
155 | <note> |
| 141 | A JDK also includes a JRE, so if you install a JDK you shouldn't have to also |
156 | A JDK also includes a JRE, so if you install a JDK you shouldn't have to also |
| 142 | have to install a JRE. |
157 | have to install a JRE. |
| … | |
… | |
| 257 | </p> |
272 | </p> |
| 258 | |
273 | |
| 259 | </body> |
274 | </body> |
| 260 | </section> |
275 | </section> |
| 261 | <section id="preferred-vm"> |
276 | <section id="preferred-vm"> |
| 262 | <title>Preferred VM</title> |
277 | <title>Preferred Build VM</title> |
| 263 | <body> |
278 | <body> |
| 264 | |
279 | |
| 265 | <p> |
|
|
| 266 | While merging Java packages, the VM can and will be switched as necessary. |
|
|
| 267 | </p> |
280 | <p> |
| 268 | |
281 | While merging Java packages, the VM used for building can sometimes be different |
|
|
282 | from the one currently set as the system VM. |
| 269 | <p> |
283 | </p> |
| 270 | Because of the wide variety of available VMs, we do not have the resources to |
284 | |
| 271 | test and verify every package works on all of them. So to ensure that every |
285 | <p> |
| 272 | packages merges smoothly, we have defined a list of <e>default/supported |
286 | This merge time VM switching is needed when, for example, your system-vm is |
|
|
287 | set to a 1.6 VM and the package you are merging requires a 1.5 VM. While merging |
|
|
288 | it will select and use a 1.5 VM, leaving your system-vm choice intact. |
|
|
289 | </p> |
|
|
290 | |
|
|
291 | <p> |
|
|
292 | To define which VM is selected when a switch is needed, we have created a list of <e>default/supported |
| 273 | VMs</e> per arch. You can find them in |
293 | VMs</e> per arch. You can find them in |
| 274 | <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>. |
| 275 | merging a Java package, and it detects one of the VM in that file is installed, |
|
|
| 276 | it will automatically use that VM, instead of the system-vm. |
|
|
| 277 | </p> |
|
|
| 278 | |
|
|
| 279 | <p> |
295 | </p> |
| 280 | The merge time VM switching is also needed when, for example, your system-vm is |
296 | |
| 281 | set a 1.4 VM and the package you are merging requires a 1.5 VM. While merging |
|
|
| 282 | it will use the preferred 1.5 VM, leaving your system-vm choice intact. |
|
|
| 283 | </p> |
297 | <p> |
| 284 | |
298 | You can override these defaults (and even your selected system VM) in |
| 285 | <p> |
|
|
| 286 | Of 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 |
299 | <path>/etc/java-config-2/build/jdk.conf</path> and have complete control over |
| 288 | which VM will get used. Some examples: |
300 | which VM will get used for merging. Some examples: |
| 289 | </p> |
301 | </p> |
| 290 | |
302 | |
| 291 | <pre caption="Example /etc/java-config-2/build/jdk.conf"> |
303 | <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> |
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> |
| 293 | *=sun-jdk |
305 | *=sun-jdk |
| … | |
… | |
| 305 | 1.5=sun-jdk |
317 | 1.5=sun-jdk |
| 306 | </pre> |
318 | </pre> |
| 307 | |
319 | |
| 308 | <warn> |
320 | <warn> |
| 309 | You do not <e>have</e> to edit this file. If you change these options to use a |
321 | You do not <e>have</e> to edit this file. If you change these options to use a |
| 310 | unsupported VM, things could possibly break. Bugs reported with a unsupported VM |
322 | unsupported VM, things could possibly break. Because of the wide variety of |
|
|
323 | available VMs, we do not have the resources to test and verify every package |
|
|
324 | works on all of them. Bugs reported with a unsupported VM won't be prioritized |
| 311 | won't be prioritized as much as bugs present within supported VMs. |
325 | as much as bugs present within supported VMs. |
| 312 | </warn> |
326 | </warn> |
| 313 | |
327 | |
| 314 | </body> |
328 | </body> |
| 315 | </section> |
329 | </section> |
| 316 | </chapter> |
330 | </chapter> |
| … | |
… | |
| 319 | <title>Compilers</title> |
333 | <title>Compilers</title> |
| 320 | <section> |
334 | <section> |
| 321 | <body> |
335 | <body> |
| 322 | |
336 | |
| 323 | <p> |
337 | <p> |
| 324 | The standard Java compiler used for building is javac, which comes with each |
338 | The standard Java compiler used for building is <c>javac</c>, which comes with |
| 325 | JDK. In addition to configuring the VM used at build time, it is also possible |
339 | each JDK. In addition to configuring the VM used at build time, it is also |
| 326 | configure which compiler is used. Essentially, you define a list your |
340 | possible configure which compiler is used. Essentially, you define a list your |
| 327 | preference for which compiler to use in |
341 | preference for which compiler to use in |
| 328 | <path>/etc/java-config-2/build/compilers.conf</path>. |
342 | <path>/etc/java-config-2/build/compilers.conf</path>. |
| 329 | </p> |
343 | </p> |
| 330 | |
344 | |
| 331 | <pre caption="/etc/java-config-2/build/compilers.conf"> |
345 | <pre caption="/etc/java-config-2/build/compilers.conf"> |