/[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.10 Revision 1.11
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.10 2003/11/16 15:35:59 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/java.xml,v 1.11 2003/11/21 18:47:08 neysx 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 <author title="Author and Editor"> 8<author title="Author and Editor">
8 <mail link="karltk@gentoo.org">Karl Trygve Kalleberg</mail> 9 <mail link="karltk@gentoo.org">Karl Trygve Kalleberg</mail>
9 </author> 10</author>
10 <author title="Editor"> 11<author title="Editor">
11 <mail link="swift@gentoo.org">Sven Vermeulen</mail> 12 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
12 </author> 13</author>
13 14
14 <abstract> 15<abstract>
15 Users' and Developers' Guide to Java in Gentoo 16Users' and Developers' Guide to Java in Gentoo
16 </abstract> 17</abstract>
17 18
18 <license/> 19<license/>
19 20
20 <version>0.1.3</version> 21<version>0.1.3</version>
21 <date>November 16, 2003</date> 22<date>November 16, 2003</date>
22 23
23 <chapter> 24<chapter>
24 <title>Installing a JDK/JRE</title> 25<title>Installing a JDK/JRE</title>
25 <section> 26<section>
26 <title>Overview</title> 27<title>Overview</title>
27 <body> 28<body>
28 29
30<p>
29 <p>Gentoo provides numerous JDKs and JREs. The default is the 31Gentoo provides numerous JDKs and JREs. The default is the Blackdown JDK/JRE
30 Blackdown JDK/JRE pair, as it is freely (beer) available without any 32pair, as it is freely (beer) available without any registration fuss.
31 registration fuss. 33</p>
32 </p>
33 34
35<note>
34 <note>As kaffe becomes a JRE/JDK drop-in replacement, that will most 36As kaffe becomes a JRE/JDK drop-in replacement, that will most likely become our
35 likely become our default. 37default.
36 </note> 38</note>
37 39
40<p>
38 <p>Both the Sun JDK/JRE and the IBM JDK/JRE are generally faster, but 41Both the Sun JDK/JRE and the IBM JDK/JRE are generally faster, but getting them
39 getting them is a bit more work, as you are required to read and 42is a bit more work, as you are required to read and accept their license before
40 accept their license before downloading (IBM additionally requires you 43downloading (IBM additionally requires you to register).
41 to register). 44</p>
42 </p>
43 45
46<p>
44 <p>Our ebuilds for the Sun and IBM JDK/JREs will notify you of where 47Our ebuilds for the Sun and IBM JDK/JREs will notify you of where to go to
45 to go to download them. 48download them.
46 </p> 49</p>
47 50
48 </body> 51</body>
49 </section> 52</section>
50 53
51 <section> 54<section>
52 <title>Installing the Sun/IBM JDK/JREs</title> 55<title>Installing the Sun/IBM JDK/JREs</title>
53 <body> 56<body>
54 57
58<p>
55 <p>If you run <c>emerge sun-jdk-1.3.1</c> or <c>emerge 59If you run <c>emerge sun-jdk-1.3.1</c> or <c>emerge ibm-jdk-1.3.1</c>, you will
56 ibm-jdk-1.3.1</c>, you will be notified that you are required 60be notified that you are required to download the actual tarballs yourself. This
57 to download the actual tarballs yourself. This has to do with license 61has to do with license restrictions for the Sun JDK/JRE (online click-wrap
58 restrictions for the Sun JDK/JRE (online click-wrap license) and
59 registration issues with the IBM JDK/JRE. 62license) and registration issues with the IBM JDK/JRE.
60 </p> 63</p>
61 64
62 <note>There is also a sun-jdk-1.4.0, but not all packages 65<note>
63 work nicely with Java 1.4, so you're on your own if you use the 1.4.0 66There is also a sun-jdk-1.4.0, but not all packages work nicely with Java 1.4,
64 JDK. 67so you're on your own if you use the 1.4.0 JDK.
65 </note> 68</note>
66 69
70<p>
67 <p>You should download the indicated file(s) into 71You should download the indicated file(s) into
68 <path>/usr/portage/distfiles</path>. Once that is done, you can rerun 72<path>/usr/portage/distfiles</path>. Once that is done, you can rerun the emerge
69 the emerge command, then the JDK/JRE will be installed properly into 73command, then the JDK/JRE will be installed properly into <path>/opt</path>.
70 <path>/opt</path>. 74</p>
71 </p> 75
72
73 </body> 76</body>
74 </section> 77</section>
75 </chapter> 78</chapter>
76 79
77 <chapter> 80<chapter>
78 <title>Configuring your JDK/JRE</title> 81<title>Configuring your JDK/JRE</title>
79
80 <section> 82<section>
81 <title>Overview</title> 83<title>Overview</title>
82
83 <body> 84<body>
84 85
86<p>
85 <p>Gentoo has the ability to have multiple JDKs and JREs installed 87Gentoo has the ability to have multiple JDKs and JREs installed without them
86 without them conflicting. 88conflicting.
87 </p> 89</p>
88 90
91<p>
89 <p>Using the <c>java-config</c> tool, you can set the system-wide 92Using the <c>java-config</c> tool, you can set the system-wide default if you
90 default if you have root access. Users can also use <c>java-config</c> 93have root access. Users can also use <c>java-config</c> to set up their own
91 to set up their own personal default, that is different from the 94personal default, that is different from the system-wide default.
92 system-wide default. 95</p>
93 </p> 96
94
95 </body> 97</body>
96 </section> 98</section>
97 99
98 <section> 100<section>
99 <title>Setting a default JDK/JRE</title> 101<title>Setting a default JDK/JRE</title>
100 <body> 102<body>
101 103
104<p>
102 <p>Running the command <c>java-config --list-available-vms</c> will 105Running the command <c>java-config --list-available-vms</c> will give you a list
103 give you a list of all availble JREs and JDKs on your system, thus:</p> 106of all availble JREs and JDKs on your system, thus:
104 107</p>
108
105 <pre caption = "Listing available VMs"> 109<pre caption="Listing available VMs">
106[%1 ~] java-config --list-available-vms 110[%1 ~] java-config --list-available-vms
107[blackdown-jdk-1.3.1] Blackdown JDK 1.3.1 (/etc/env.d/java/20blackdown-jdk-1.3.1) 111[blackdown-jdk-1.3.1] Blackdown JDK 1.3.1 (/etc/env.d/java/20blackdown-jdk-1.3.1)
108[blackdown-jre-1.3.1] Blackdown JRE 1.3.1 (/etc/env.d/java/20blackdown-jre-1.3.1) 112[blackdown-jre-1.3.1] Blackdown JRE 1.3.1 (/etc/env.d/java/20blackdown-jre-1.3.1)
109[ibm-jdk-1.3.0] IBM JDK 1.3.0 (/etc/env.d/java/20ibm-jdk-1.3.0) 113[ibm-jdk-1.3.0] IBM JDK 1.3.0 (/etc/env.d/java/20ibm-jdk-1.3.0)
110[ibm-jdk-1.3.1] IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1) 114[ibm-jdk-1.3.1] IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1)
111[ibm-jre-1.3.1] IBM JRE 1.3.1 (/etc/env.d/java/20ibm-jre-1.3.1) 115[ibm-jre-1.3.1] IBM JRE 1.3.1 (/etc/env.d/java/20ibm-jre-1.3.1)
112[sun-jdk-1.4.0] Sun JDK 1.4.0 (/etc/env.d/java/20sun-jdk-1.4.0) 116[sun-jdk-1.4.0] Sun JDK 1.4.0 (/etc/env.d/java/20sun-jdk-1.4.0)
113 </pre> 117</pre>
114 118
119<p>
115 <p>The name in the brackets <path>"[]"</path> is the handle or ID for 120The name in the brackets <path>"[]"</path> is the handle or ID for that
116 that particular VM. You use pass that ID to <c>java-config 121particular VM. You use pass that ID to <c>java-config --set-system-vm</c>, thus:
117 --set-system-vm</c>, thus: 122</p>
118 </p>
119 123
120 <pre caption = "Setting the System VM"> 124<pre caption="Setting the System VM">
121[#1 ~] java-config --set-system-vm=ibm-jdk-1.3.1 125[#1 ~] java-config --set-system-vm=ibm-jdk-1.3.1
122Now using IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1) 126Now using IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1)
123 </pre> 127</pre>
124 128
129<note>
125 <note>You will have to be root to run --set-system-vm 130You will have to be root to run --set-system-vm.
126 </note> 131</note>
127 132
133<p>
128 <p>Once you have issued <c>java-config --set-system-vm</c> with a 134Once you have issued <c>java-config --set-system-vm</c> with a particular VM ID,
129 particular VM ID, you will need to regenerate your /etc/profile.env, 135you will need to regenerate your /etc/profile.env, thus:
130 thus: 136</p>
131 </p> 137
132
133 <pre caption = "Regenerating /etc/profile.env" > 138<pre caption="Regenerating /etc/profile.env" >
134[#1 ~] env-update 139[#1 ~] env-update
135 </pre> 140</pre>
136 141
142<p>
137 <p>After this, you will either want to relogin, or resource 143After this, you will either want to relogin, or resource
138 <path>/etc/profile</path> into your environment. 144<path>/etc/profile</path> into your environment.
139 </p> 145</p>
140 146
147<p>
141 <p>As a regular user, you can use <c>java-config --set-user-vm</c>, 148As a regular user, you can use <c>java-config --set-user-vm</c>, which will
142 which will create <path>$HOME/.gentoo/java-env</path> with all 149create <path>$HOME/.gentoo/java-env</path> with all required env vars. You would
143 required env vars. You would normally source this from your shell's 150normally source this from your shell's startup script
144 startup script (<path>$HOME/.zshenv</path> in my case).</p> 151(<path>$HOME/.zshenv</path> in my case).
145 152</p>
153
146 </body> 154</body>
147 </section> 155</section>
148 156
149 <section> 157<section>
150 <title>Setting a default CLASSPATH</title> 158<title>Setting a default CLASSPATH</title>
151 <body> 159<body>
152 160
161<p>
153 <p><c>java-config</c> can also be used to set a system-wide default 162<c>java-config</c> can also be used to set a system-wide default CLASSPATH, and
154 CLASSPATH, and of course a user-specific default CLASSPATH. 163of course a user-specific default CLASSPATH.
155 </p> 164</p>
156 165
166<p>
157 <p>First you want to list available java libraries that might be 167First you want to list available java libraries that might be interesting to put
158 interesting to put in your CLASSPATH, thus: 168in your CLASSPATH, thus:
159 </p> 169</p>
160 170
161 <pre caption = "Listing classes"> 171<pre caption="Listing classes">
162[%1 ~] java-config --list-available-packages 172[%1 ~] java-config --list-available-packages
163[ant] No description (/usr/share/ant/classpath.env) 173[ant] No description (/usr/share/ant/classpath.env)
164[java-gnome] No description (/usr/share/java-gnome/classpath.env) 174[java-gnome] No description (/usr/share/java-gnome/classpath.env)
165[java-gtk] No description (/usr/share/java-gtk/classpath.env) 175[java-gtk] No description (/usr/share/java-gtk/classpath.env)
166[log4j] "" (/usr/share/log4j/package.env) 176[log4j] "" (/usr/share/log4j/package.env)
167 </pre> 177</pre>
168 178
179<note>
169 <note>None of these packages have a proper description. That is 180None of these packages have a proper description. That is something that will be
170 something that will be implemented in the not-so-distant 181implemented in the not-so-distant future.
171 future.
172 </note> 182</note>
173 183
184<p>
174 <p>Again, the name in brackets <path>"[]"</path> are the IDs that you 185Again, the name in brackets <path>"[]"</path> are the IDs that you have to pass
175 have to pass to <c>java-config --set-system-classpath</c>, thus: 186to <c>java-config --set-system-classpath</c>, thus:
176 </p> 187</p>
177 188
178 <pre caption = "Setting classpaths"> 189<pre caption="Setting classpaths">
179java-config --set-system-classpath=log4j,java-gtk,java-gnome 190java-config --set-system-classpath=log4j,java-gtk,java-gnome
180 </pre> 191</pre>
181 192
193<note>
182 <note>The current directory (.) will not be part of the system classpath, 194The current directory (.) will not be part of the system classpath, as that
183 as that should be added in root's login profile. 195should be added in root's login profile.
184 </note> 196</note>
185 197
198<p>
186 <p>Again, you will want to run <c>env-update</c> to update your 199Again, you will want to run <c>env-update</c> to update your system's
187 system's environment, and you might also want to relogin or resource 200environment, and you might also want to relogin or resource the
188 the <path>/etc/profile</path>. 201<path>/etc/profile</path>.
189 </p> 202</p>
190 203
204<p>
191 <p>For users, <c>java-config --set-user-classpath</c> will create 205For users, <c>java-config --set-user-classpath</c> will create
192 <path>$HOME/.gentoo/java-env-classpath</path>, which is automatically 206<path>$HOME/.gentoo/java-env-classpath</path>, which is automatically included
193 included by <path>$HOME/.gentoo/java-env</path>. 207by <path>$HOME/.gentoo/java-env</path>.
194 </p> 208</p>
195 209
196 </body> 210</body>
197 </section> 211</section>
198 </chapter> 212</chapter>
199 213
200 <chapter> 214<chapter>
201 <title>Additional resources</title> 215<title>Additional resources</title>
202 <section> 216<section>
203 <title>Off-line resources</title> 217<title>Off-line resources</title>
204
205 <body> 218<body>
206 219
207 <ul> 220<ul>
208 <li>java-config man page</li> 221<li>java-config man page</li>
209 <li><c>java-config --help</c></li> 222<li><c>java-config --help</c></li>
210 <li>The <path>/usr/bin/java-config</path> script itself</li> 223<li>The <path>/usr/bin/java-config</path> script itself</li>
211 </ul> 224</ul>
212 225
213 </body> 226</body>
214 </section> 227</section>
215 228
216 <section> 229<section>
217 <title>Online resources</title> 230<title>Online resources</title>
218
219 <body> 231<body>
220 232
221 <ul> 233<ul>
222 <li>The <uri link="http://news.gmane.org/gmane.linux.gentoo.devel"> 234<li>The <uri link="http://news.gmane.org/gmane.linux.gentoo.devel"
223 gentoo-dev </uri>, 235>gentoo-dev</uri>, <uri link="http://news.gmane.org/gmane.linux.gentoo.user"
224 <uri link="http://news.gmane.org/gmane.linux.gentoo.user"> gentoo-user
225 </uri> mailing list archives</li> 236>gentoo-user </uri> mailing list archives</li>
226 <li>#gentoo on irc.openprojects.net</li> 237<li>#gentoo on irc.openprojects.net</li>
227 </ul> 238</ul>
228 239
229 </body> 240</body>
230 </section> 241</section>
231 </chapter> 242</chapter>
232</guide> 243</guide>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20