1 |
maxim wexler wrote: |
2 |
> |
3 |
>> So we have to get Java back into your path... I've |
4 |
>> got Sun Java, so mine |
5 |
>> will be slightly different than yours, but in your |
6 |
>> /etc/env.d/ and |
7 |
>> /etc/env.d/java directory you should have a couple |
8 |
>> of files in there. |
9 |
>> First you will have something like |
10 |
>> /etc/env.d/java/20sun-jdk-1.4.2.10. |
11 |
>> Each file in /etc/env.d/java/ represents each |
12 |
>> version of java you have |
13 |
>> installed on your system (thus you could have |
14 |
>> multiple versions and |
15 |
>> switch between them). my |
16 |
>> /etc/env.d/java/20sun-jdk-1.4.2.10 contains |
17 |
>> the following. |
18 |
>> |
19 |
>> # Copyright 1999-2004 Gentoo Foundation |
20 |
>> # Distributed under the terms of the GNU General |
21 |
>> Public License v2 |
22 |
>> # $Header: |
23 |
>> |
24 |
>> |
25 |
> /var/cvsroot/gentoo-x86/dev-java/sun-jdk/files/sun-jdk-1.4.2.10,v |
26 |
> |
27 |
>> 1.2 |
28 |
>> 2006/01/08 23:27:53 nichoj Exp $ |
29 |
>> |
30 |
>> VERSION="Sun JDK 1.4.2.10" |
31 |
>> JAVA_HOME=/opt/sun-jdk-1.4.2.10 |
32 |
>> JDK_HOME=/opt/sun-jdk-1.4.2.10 |
33 |
>> JAVAC=${JAVA_HOME}/bin/javac |
34 |
>> |
35 |
>> |
36 |
> ADDPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin:${JAVA_HOME}/jre/javaws" |
37 |
> |
38 |
> ADDLDPATH="${JAVA_HOME}/jre/lib/i686/:${JAVA_HOME}/jre/lib/i686/native_threads/:${JAVA_HOME}/jre/lib/i686/client/:${JAVA_HOME}/jre/lib/i686/server/" |
39 |
> |
40 |
>> MANPATH="/opt/sun-jdk-1.4.2.10/man" |
41 |
>> ENV_VARS="JAVA_HOME JDK_HOME JAVAC ADDPATH ADDLDPATH |
42 |
>> MANPATH" |
43 |
>> |
44 |
>> You should also have something like |
45 |
>> /etc/env.d/20java This would be the |
46 |
>> version of java you currently have set (active). In |
47 |
>> my case, because I |
48 |
>> only have one java installed, it will largely be the |
49 |
>> same. its contents |
50 |
>> are: |
51 |
>> |
52 |
>> # Autogenerated by java-config |
53 |
>> # Command: --set-system-vm=sun-jdk-1.4.2.10 |
54 |
>> JDK_HOME=/opt/sun-jdk-1.4.2.10 |
55 |
>> JAVAC=/opt/sun-jdk-1.4.2.10/bin/javac |
56 |
>> |
57 |
>> |
58 |
> PATH="/opt/sun-jdk-1.4.2.10/bin:/opt/sun-jdk-1.4.2.10/jre/bin:/opt/sun-jdk-1.4.2.10/jre/javaws" |
59 |
> |
60 |
> ROOTPATH="/opt/sun-jdk-1.4.2.10/bin:/opt/sun-jdk-1.4.2.10/jre/bin:/opt/sun-jdk-1.4.2.10/jre/javaws" |
61 |
> |
62 |
> LDPATH="/opt/sun-jdk-1.4.2.10/jre/lib/i686/:/opt/sun-jdk-1.4.2.10/jre/lib/i686/native_threads/:/opt/sun-jdk-1.4.2.10/jre/lib/i686/client/:/opt/sun-jdk-1.4.2.10/jre/lib/i686/server/" |
63 |
> |
64 |
>> # VERSION="Sun JDK 1.4.2.10" |
65 |
>> MANPATH=${MANPATH}:/opt/sun-jdk-1.4.2.10/man |
66 |
>> JAVA_HOME=/opt/sun-jdk-1.4.2.10 |
67 |
>> |
68 |
>> Now if you have a file in |
69 |
>> /etc/env.d/java/<something> but don't have an |
70 |
>> /etc/env.d/20java (or if you do, it is empty), then |
71 |
>> you should be able |
72 |
>> to fix that with java-config (man java-config). |
73 |
>> However if both files |
74 |
>> /etc/env.d/java/<something> and /etc/env.d/20java |
75 |
>> seem legit, then we |
76 |
>> need to see why bash isn't sourcing the env.d files. |
77 |
>> In fact now that I |
78 |
>> think about it, that might be your problem, as your |
79 |
>> path did seem to be |
80 |
>> quite short. Mine for instance is: |
81 |
>> |
82 |
>> echo $PATH |
83 |
>> |
84 |
>> |
85 |
> /usr/lib/ccache/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.4.5:/opt/sun-jdk-1.4.2.10/bin:/opt/sun-jdk-1.4.2.10/jre/bin:/opt/sun-jdk-1.4.2.10/jre/javaws:/usr/qt/3/bin:/usr/games/bin |
86 |
> |
87 |
>> Before I start speculating any further, let me know |
88 |
>> where the above |
89 |
>> leads you... |
90 |
>> |
91 |
> |
92 |
> heathen@sarawak ~ $ ls /etc/env.d |
93 |
> 00basic 05portage.envd 30java-finalclasspath |
94 |
> 50ncurses binutils |
95 |
> 01hostname 09ati 45qt3 |
96 |
> 50qtdir3 gcc |
97 |
> 02distcc 10MozillaFirefox 46kdepaths-3.4 |
98 |
> 60ladspa java |
99 |
> 03opengl 10mozilla 50gconf |
100 |
> 70less |
101 |
> 05binutils 10xorg 50glib2 |
102 |
> 99kde-env |
103 |
> 05gcc 20java 50gtk2 |
104 |
> 99limewire |
105 |
> heathen@sarawak ~ $ ls /etc/env.d/java |
106 |
> 20blackdown-jdk-1.4.2.02 20blackdown-jre-1.4.2.02 |
107 |
> |
108 |
> When I do the following limewire comes back: |
109 |
> |
110 |
> PATH=$PATH:/path/to/java/bin |
111 |
> export PATH |
112 |
> |
113 |
> But it doesn't survive a reboot. |
114 |
> |
115 |
> Somebody said put those commands into ~/.bash_profile. |
116 |
> How would that work? I mean what's the syntax? Just |
117 |
> like they are there. This is all I got in |
118 |
> .bash_profile now: |
119 |
> |
120 |
> heathen@sarawak ~ $ cat .bash_profile |
121 |
> # /etc/skel/.bash_profile: |
122 |
> # $Header: |
123 |
> /var/cvsroot/gentoo-x86/app-shells/bash/files/dot-bash_profile,v |
124 |
> 1.1 2005/04/30 00:08:01 vapier Exp $ |
125 |
> |
126 |
> # This file is sourced by bash for login shells. The |
127 |
> following line |
128 |
> # runs your .bashrc and is recommended by the bash |
129 |
> info pages. |
130 |
> [[ -f ~/.bashrc ]] && . ~/.bashrc |
131 |
> |
132 |
> |
133 |
> |
134 |
>> |
135 |
>> -- |
136 |
>> gentoo-user@g.o mailing list |
137 |
>> |
138 |
>> |
139 |
>> |
140 |
> |
141 |
> |
142 |
> __________________________________________________ |
143 |
> Do You Yahoo!? |
144 |
> Tired of spam? Yahoo! Mail has the best spam protection around |
145 |
> http://mail.yahoo.com |
146 |
> |
147 |
The problem here is that you don't want to hard code it into your |
148 |
.bash_profile as that is only local (to that specific user). you could |
149 |
do it in /etc/profile, but that would only work until the next java |
150 |
upgrade... it looks like you have a java in /etc/env.d/java. what |
151 |
happens if you run java-config (man java-config for the syntax). you |
152 |
can use it to show the view the current jvm/jdk as well as set it, which |
153 |
is what we'll want to do if it isn't set. |
154 |
|
155 |
also, what is contained in /etc/env.d/20java ? |
156 |
|
157 |
also for giggles, can you put the output of the command "env" here as well? |
158 |
|
159 |
|
160 |
|
161 |
-- |
162 |
gentoo-user@g.o mailing list |