classpath issues Linux

Hello,

I’m recently having the following problem.
When I try to compile a program with


javac -classpath "/home/nico/extrajars/jogl/*:." HoofdDraad.java

the following message appears:


incorrect classpath: /home/nico/extrajars/jogl/*

This used to work for me!
Both gluegen-rt.jar and jogl.jar are in /home/nico/extrajars/jogl/ ,
Normally I compile java-programs in Eclipse, so it can be that this problem is not that recent.

I can run programs with


java -classpath "/homenico/extrajars/jogl/*:." HoofdDraad

java -version gives me


java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

and I’m working with Xubuntu 7.04.

I believe it’s a bug but I’m unsure.

I would guess that java doesn’t know what to do with the * character. Does it work if you manually specify each jar?

It works that way.
Still strange, it used to work with * and


java -classpath "/homenico/extrajars/jogl/*:." HoofdDraad

also doesn’t give any problems.

It is odd. The man pages say that javac can deal with the *, exactly as java does. What has changed since this command last worked for you?

I’ve been using eclipse for a while(couple of months), so I didn’t need the command-line (actually, I use Geany for small programs), so I don’t really know what could have been changed, maybe java-build?
Am I the only one witch this ‘problem’ ?

It works for me. Testing with lwjgl jars, I steal the DisplayTest source, remove the package declaration, and get


ryanm@windfall:~/test$ pwd
/home/ryanm/test
ryanm@windfall:~/test$ ls
DisplayTest.java  lwjgl-1.1.3  lwjgl-1.1.3.zip
ryanm@windfall:~/test$ javac -classpath "/home/ryanm/test/lwjgl-1.1.3/jar/*:." DisplayTest.java
ryanm@windfall:~/test$ ls
DisplayTest.class  DisplayTest.java  lwjgl-1.1.3  lwjgl-1.1.3.zip
ryanm@windfall:~/test$ javac -version
javac 1.6.0_03

A though occurs: *Ubuntu ships by default with GIJ installed. Did you remove this when you installed Sun’s java? Maybe there’s been some snafu and the gnu javac is on the PATH before Sun’s? Try “javac -version” to test. Completely clutching at straws here, but worth eliminating.

edit: also, I’ve never seen a “incorrect classpath” error. IME when the classpath is wrong you just get loads of compile errors for the missing types.

It works again :smiley:

I had to remove ejc too to make it happen.

javac -version did gave me


java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

Oh yes, it did give all those compile-errors too.

Thanks alot