/[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.38 Revision 1.39
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.38 2007/01/23 19:35:12 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/java.xml,v 1.39 2007/04/29 02:36:16 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
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>
11<author title="Author"> 11<author title="Author">
12 <mail link="karltk@gentoo.org">Karl Trygve Kalleberg</mail> 12 <mail link="karltk@gentoo.org">Karl Trygve Kalleberg</mail>
13</author> 13</author>
14<author title="Editor"> 14<author title="Editor">
15 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail> 15 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
16</author> 16</author>
17 17
18<abstract> 18<abstract>
19This guide will introduce you to Java and explain how to use Java with Gentoo 19This guide will introduce you to Java and explain how to use Java with Gentoo
20Linux. 20Linux.
21</abstract> 21</abstract>
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.14</version> 27<version>0.15</version>
28<date>2007-01-23</date> 28<date>2007-04-28</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>
34<body> 34<body>
35 35
36<p> 36<p>
37Java is a programming language developed by engineers of Sun Microsystems. The 37Java is a programming language developed by engineers of Sun Microsystems. The
38language is object-oriented and designed to run on multiple platforms without 38language is object-oriented and designed to run on multiple platforms without
39the need of recompiling code for each platform. Although Java can be compiled 39the need of recompiling code for each platform. Although Java can be compiled
40as a native program, much of Java's popularity can be attributed to its 40as a native program, much of Java's popularity can be attributed to its
41portability, along with other features such as garbage collection. To make 41portability, along with other features such as garbage collection. To make
42platform independence possible the Java compiler compiles the Java code to an 42platform independence possible the Java compiler compiles the Java code to an
43intermediate representation called "Java bytecode" that runs on a JRE (Java 43intermediate representation called "Java bytecode" that runs on a JRE (Java
44Runtime Environment) and not directly on the operating system. 44Runtime Environment) and not directly on the operating system.
45</p> 45</p>
46 46
47<p> 47<p>
48In order to run Java bytecode, one needs to have a JRE (Java Runtime 48In order to run Java bytecode, one needs to have a JRE (Java Runtime
49Environment) installed. A JRE provides core libraries, a platform dependent 49Environment) installed. A JRE provides core libraries, a platform dependent
50Java Virtual Machine, plug-ins for browsers, among other things. A JDK (Java 50Java Virtual Machine, plugins for browsers, among other things. A JDK (Java
51Development Kit) adds programming tools, such as a bytecode compiler and a 51Development Kit) adds programming tools, such as a bytecode compiler and a
52debugger. 52debugger.
53</p> 53</p>
54 54
55</body> 55</body>
56</section> 56</section>
57</chapter> 57</chapter>
58 58
59<chapter> 59<chapter>
60<title>Before You Begin</title> 60<title>Before You Begin</title>
61<section> 61<section>
62<title>Existing installs</title> 62<title>Existing installs</title>
63<body> 63<body>
64 64
65<p> 65<p>
456<p> 456<p>
457If you really want a system wide or user default classpath you can add 457If you really want a system wide or user default classpath you can add
458something like the following to your shell's profile. But we would advise 458something like the following to your shell's profile. But we would advise
459against it. 459against it.
460</p> 460</p>
461 461
462<pre caption="Setting classpath"> 462<pre caption="Setting classpath">
463# <i>export CLASSPATH="${CLASSPATH}:$(java-config --classpath log4j,xerces-2)"</i> 463# <i>export CLASSPATH="${CLASSPATH}:$(java-config --classpath log4j,xerces-2)"</i>
464</pre> 464</pre>
465 465
466</body> 466</body>
467</section> 467</section>
468</chapter> 468</chapter>
469 469
470<chapter> 470<chapter>
471<title>Java Browser Plug-ins</title> 471<title>Java Browser Plugins</title>
472<section> 472<section>
473<title>Installing a plug-in</title> 473<title>Installing a plugin</title>
474<body> 474<body>
475 475
476<p> 476<p>
477You can install a Java plug-in for your web browser by emerging a Java VM with 477You can install a Java plugin for your web browser by emerging a Java VM with
478the <c>nsplugin</c> USE flag set. 478the <c>nsplugin</c> USE flag set.
479</p> 479</p>
480 480
481<note> 481<note>
482<c>nsplugin</c> is not available for all architectures. Check for available 482<c>nsplugin</c> is not available for all architectures. Check for available
483plug-ins on your arch before trying to install a VM by running <c>emerge -pv 483plugins on your arch before trying to install a VM by running <c>emerge -pv
484&lt;java-vm&gt;</c>. 484&lt;java-vm&gt;</c>.
485</note> 485</note>
486 486
487<p> 487<p>
488Portage will allow you to install multiple versions of Java plug-ins, though 488Portage will allow you to install multiple versions of Java plugins, though
489only one will be used by your browser. You can check the list of available 489only one will be used by your browser. You can check the list of available
490plug-ins by running: 490plugins by running:
491</p> 491</p>
492 492
493<pre caption="Viewing available plug-ins"> 493<pre caption="Viewing available plugins">
494# <i>eselect java-nsplugin list</i> 494# <i>eselect java-nsplugin list</i>
495 [1] sun-jre-bin-1.5 495 [1] sun-jre-bin-1.5
496 [2] blackdown-jre-1.4.2 496 [2] blackdown-jre-1.4.2
497</pre> 497</pre>
498 498
499<p> 499<p>
500In this example, <c>sun-jre-bin</c> is selected for the browser plug-in. 500In this example, <c>sun-jre-bin</c> is selected for the browser plugin.
501</p> 501</p>
502 502
503<pre caption="Selecting a plug-in"> 503<pre caption="Selecting a plugin">
504# <i>eselect java-nsplugin set sun-jre-bin-1.5</i> 504# <i>eselect java-nsplugin set sun-jre-bin-1.5</i>
505</pre> 505</pre>
506 506
507<p> 507<p>
508Verify that the correct plug-in was selected: 508Verify that the correct plugin was selected:
509</p> 509</p>
510 510
511<pre caption="Verifying the correct plug-in"> 511<pre caption="Verifying the correct plugin">
512# <i>eselect java-nsplugin list</i> 512# <i>eselect java-nsplugin list</i>
513 [1] sun-jre-bin-1.5 current 513 [1] sun-jre-bin-1.5 current
514 [2] blackdown-jre-1.4.2 514 [2] blackdown-jre-1.4.2
515</pre> 515</pre>
516 516
517<p> 517<p>
518Java.com also provides a link to <uri 518Java.com also provides a link to <uri
519link="http://java.com/en/download/installed.jsp">verify your installed 519link="http://java.com/en/download/installed.jsp">verify your installed
520plug-in</uri>. Additionally, if you are using a Mozilla-based browser, you can 520plugin</uri>. Additionally, if you are using a Mozilla-based browser, you can
521verify your Java plug-in by typing <c>about:plugins</c> into the address bar. 521verify your Java plugin by typing <c>about:plugins</c> into the address bar.
522</p> 522</p>
523 523
524</body> 524</body>
525</section>
526<section> 525</section>
526<section>
527<title>Plug-ins on multilib systems</title> 527<title>Plugins on multilib systems</title>
528<body> 528<body>
529 529
530<p> 530<p>
531If you are running a mixed 64-bit and 32-bit multilib system (for example, on AMD64), 531If you are running a mixed 64-bit and 32-bit multilib system (for example, on AMD64),
532you can have both 64-bit and a 32-bit Java plug-ins installed. 532you can only use 32-bit Java plugins.
533</p>
534
535<p> 533</p>
534
535<p>
536To use a 32-bit plug-in, you will need to emerge <c>emul-linux-x86-java</c> with 536To use a 32-bit plugin, you will need to emerge <c>emul-linux-x86-java</c> with
537the <c>nsplugin</c> USE flag enabled. 537the <c>nsplugin</c> USE flag enabled.
538</p> 538</p>
539 539
540<pre caption="Installing a 32-bit plug-in"> 540<pre caption="Installing a 32-bit plugin">
541# <i>echo "app-emulation/emul-linux-x86-java nsplugin" >> /etc/portage/package.use</i> 541# <i>echo "app-emulation/emul-linux-x86-java nsplugin" >> /etc/portage/package.use</i>
542# <i>emerge emul-linux-x86-java</i> 542# <i>emerge emul-linux-x86-java</i>
543</pre> 543</pre>
544 544
545<p> 545<p>
546Next, check which plug-ins are available: 546Next, check which plugins are available:
547</p> 547</p>
548 548
549<pre caption="Viewing available plug-ins"> 549<pre caption="Viewing available plugins">
550# <i>eselect java-nsplugin list</i> 550# <i>eselect java-nsplugin list</i>
551Available 32-bit Java browser plugins 551Available 32-bit Java browser plugins
552 [1] emul-linux-x86-java-1.4.2 552 [1] emul-linux-x86-java-1.4.2
553 [2] emul-linux-x86-java-1.5 553 [2] emul-linux-x86-java-1.5
554Available 64-bit Java browser plugins
555 [1] blackdown-jdk-1.4.2
556 [2] blackdown-jre-1.4.2
557</pre> 554</pre>
558 555
559<p>
560You can select a 32-bit plug-in for a 32-bit browser (for example,
561<c>firefox-bin</c>), and you can select a 64-bit plug-in for your 64-bit
562browser (for example, <c>konqueror</c>).
563</p> 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>
564 562
563<p>
564Now select the right plugin for your 32-bit browser:
565</p>
566
565<pre caption="Selecting plug-ins"> 567<pre caption="Selecting plugins">
566# <i>eselect java-nsplugin set 32bit emul-linux-x86-java-1.4.2</i> 568# <i>eselect java-nsplugin set 32bit emul-linux-x86-java-1.5</i>
567# <i>eselect java-nsplugin set 64bit blackdown-jdk-1.4.2</i>
568</pre> 569</pre>
569 570
570<p> 571<p>
571Verify the correct plug-ins were selected: 572Verify the correct plugin was selected:
572</p> 573</p>
573 574
574<pre caption="Verifying the correct plug-ins"> 575<pre caption="Verifying the correct plugin">
575# <i>eselect java-nsplugin list</i> 576# <i>eselect java-nsplugin list</i>
576Available 32-bit Java browser plugins 577Available 32-bit Java browser plugins
578 [1] emul-linux-x86-java-1.4.2
577 [1] emul-linux-x86-java-1.4.2 current 579 [2] emul-linux-x86-java-1.5 current
578 [2] emul-linux-x86-java-1.5
579Available 64-bit Java browser plugins
580 [1] blackdown-jdk-1.4.2 current
581 [2] blackdown-jre-1.4.2
582</pre> 580</pre>
583 581
584</body> 582</body>
585</section> 583</section>
586</chapter> 584</chapter>
587 585
588<chapter> 586<chapter>
589<title>USE flags for use with Java</title> 587<title>USE flags for use with Java</title>
590<section> 588<section>
591<title>Setting USE flags</title> 589<title>Setting USE flags</title>
592<body> 590<body>
593 591
594<p> 592<p>
595For more information regarding USE flags, refer to the <uri 593For more information regarding USE flags, refer to the <uri
596link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=2">USE flags</uri> 594link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=2">USE flags</uri>

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

  ViewVC Help
Powered by ViewVC 1.1.20