Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2705 - Wrong CLASSPATH of sun sdk1.4.0 stops me from running java apps
Summary: Wrong CLASSPATH of sun sdk1.4.0 stops me from running java apps
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Karl Trygve Kalleberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-13 13:29 UTC by Miguel Sousa Filipe
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Sousa Filipe 2002-05-13 13:29:20 UTC
[56p] tigre : ~ $ java-config --classpath  
/opt/sun-jdk-1.4.0/lib/rt.jar
[57p] tigre : ~ $ java-config --java-version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

--(tigre)-(pts1)-(22:08/14-May-02)--
--(m3thos#:~/cg)-- java Global s teapot teapot.bmp
Exception in thread "main" java.lang.NoClassDefFoundError: Global
--(tigre)-(pts1)-(22:16/14-May-02)--
--(m3thos#:~/cg)-- unset CLASSPATH
--(tigre)-(pts1)-(22:17/14-May-02)--
--(m3thos#:~/cg)-- java Global s teapot teapot.bmp
Erro Ao ler do ficheiro teapot, em LeFicheiro()
J� li do Ficheiro
Tem 0 Poligonos e 0 Arestas
J� fiz o rendering

has it's seen by this demo, I can't have java aplications working unless I unset
the $CLASSPATH environment variable.
And I don't seem to be able to unset that CLASSPATH permanently.
Comment 1 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2002-05-14 08:46:39 UTC
The reason this happens is that the default CLASSPATH does not have . in it, thus
CLASSPATH=/opt/sun-jdk-1.4.0/lib/rt.jar:.

I do not think adding this to the default CLASSPATH is such a good idea, as it
might result in unintended side-effects for various tools, especially if the "."
moves leftwards in the path-list.

You should configure your user's CLASSPATH in .bashrc or .zshrc or .tcshrc or
whatever by doing something like:
export CLASSPATH=${CLASSPATH}:. 
after you have sourced /env/profile

Please note that if you you use the preferred setup, with --set-user-classpath,
then source $HOME/.gentoo/java-env, this will not be an issue.

I will update the Java Guide to reflect this.