jar

I

ivan danicic

Hello all, I am trying to create an executable jar file from my JOGL prog.
When trying to run it (example.jar)so: java -jar example.jar I get error:
can't find class ..net/java/jogl/GLEventListener. Any suggestions or
comments gratefully received.
Ivan
 
K

Knute Johnson

ivan said:
Hello all, I am trying to create an executable jar file from my JOGL prog.
When trying to run it (example.jar)so: java -jar example.jar I get error:
can't find class ..net/java/jogl/GLEventListener. Any suggestions or
comments gratefully received.
Ivan

Well your program wants GLEventListener, where is it? Is that a class
you wrote? Is it part of example.jar? Is it in some library somewhere?
 
I

ivan danicic

Knute said:
Well your program wants GLEventListener, where is it? Is that a class
you wrote? Is it part of example.jar? Is it in some library somewhere?
Hello, I didn't write it. It's some standard jogl thing so it's probably
somewhere but the user should not tinker with that.
Ivan
 
K

Knute Johnson

ivan said:
Hello, I didn't write it. It's some standard jogl thing so it's probably
somewhere but the user should not tinker with that.
Ivan

You are not going to get very far without it as you seem to have discovered.
 
J

Joshua Cranmer

ivan said:
Hello all, I am trying to create an executable jar file from my JOGL prog.
When trying to run it (example.jar)so: java -jar example.jar I get error:
can't find class ..net/java/jogl/GLEventListener. Any suggestions or
comments gratefully received.
Ivan
Where is the JOGL jar file? If it is not in the extension directory or
in the class path, then there is your problem.
 
I

ivan danicic

Joshua said:
Where is the JOGL jar file? If it is not in the extension directory or
in the class path, then there is your problem.
Hello, it is in the current directory.
Ivan
 
I

ivan danicic

ivan said:
Hello, I didn't write it. It's some standard jogl thing so it's probably
somewhere but the user should not tinker with that.
Ivan
Hello, I see from articles on the internet that some libraries need to be
included on the manifest file and the classpath is also mentioned. It would
seem best if some kind person could give me an actual example, the simpler
the better. I am new to jar; my aim is to eventually make my program usable
with web start.
Ivan
 
K

Knute Johnson

ivan said:
Hello, I see from articles on the internet that some libraries need to be
included on the manifest file and the classpath is also mentioned. It would
seem best if some kind person could give me an actual example, the simpler
the better. I am new to jar; my aim is to eventually make my program usable
with web start.
Ivan

http://knutejohnson.com/classpath.html
 
K

Knute Johnson

Joshua said:
There's your problem. What you need to do is either move the JOGL jar
file into the extensions directory, or execute java like this:
java -cp "jogl.jar" -jar example.jar

That won't work. The classpath command line option is ignored if the
-jar option is used.
 
I

ivan danicic

Knute said:
You are not going to get very far without it as you seem to have
discovered.
Hello, I have this
file: /bla/classes/net/java/games/jogl/GLEventListener.class
How can I use this information in view of the error message "can't find
class net/java/jogl/GLEventListener" ?
Ivan
 
K

Knute Johnson

ivan said:
Hello, I have this
file: /bla/classes/net/java/games/jogl/GLEventListener.class
How can I use this information in view of the error message "can't find
class net/java/jogl/GLEventListener" ?
Ivan

Your program needs GLEventListener. If that is in a .jar file
somewhere, you need to include that file in your java classpath. The
java classpath for an application in a .jar must be specified in the
manifest file. Read the article I pointed you to it tells you
everything you need to know.
 
I

ivan danicic

ivan danicic said:
Hello, I have this
file: /bla/classes/net/java/games/jogl/GLEventListener.class
How can I use this information in view of the error message "can't find
class net/java/jogl/GLEventListener" ?
Ivan
Hello, I have solved this now by putting the line
Class-Path: /bla
into my manifest file.
This works fine except the program needs a data file "flag.bmp". If this is
inthe current directory all goes well, otherwise it can't find it.
If I do
jar cmf manifest example.jar flag.bmp
and then "java -jar example.jar " it says it can't find the main class.
Further suggestions gratefully received.
Ivan
 
K

Knute Johnson

ivan said:
Hello, I have solved this now by putting the line
Class-Path: /bla
into my manifest file.
This works fine except the program needs a data file "flag.bmp". If this
is inthe current directory all goes well, otherwise it can't find it.
If I do
jar cmf manifest example.jar flag.bmp
and then "java -jar example.jar " it says it can't find the main class.
Further suggestions gratefully received.
Ivan

You can probably add the flag.bmp file to the example.jar but you can't
jar a jar and get it to work. As far as I have been able to determine,
if you have an application in a jar you cannot retrieve a resource that
is not also in a jar.
 
I

ivan danicic

Knute said:
You can probably add the flag.bmp file to the example.jar but you can't
jar a jar and get it to work. As far as I have been able to determine,
if you have an application in a jar you cannot retrieve a resource that
is not also in a jar.
Hello, following a JAR tutorial from SUN I did this
jar uf example.jar flag.bmp
and then copying example.jar to another directory D and then cd D,
java -jar example.jar
the flag.bmp was not found, but then extracting the contents of example.jar:
jar xf example.jar (in D)
which put all files in the jar file into D, including flag.bmp so that doing
again java -jar example.jar all went well. Is this how one is supposed to
do it?
Ivan
 
A

Andrew Thompson

..I am new to jar; my aim is to eventually make my program usable
with web start.

Web start based applications do not require
a manifest, generally*. I have deployed many
web start based apps. and have never bothered
to including a manifest.

* Though inclusion of a manifest that specifies
the main class, can remove the need to explicitly
name the main, in the JNLP file.

Andrew T.
 
K

Knute Johnson

ivan said:
Hello, following a JAR tutorial from SUN I did this
jar uf example.jar flag.bmp
and then copying example.jar to another directory D and then cd D,
java -jar example.jar
the flag.bmp was not found, but then extracting the contents of example.jar:
jar xf example.jar (in D)
which put all files in the jar file into D, including flag.bmp so that doing
again java -jar example.jar all went well. Is this how one is supposed to
do it?
Ivan

I'd have to see some code and then try it myself.
 
I

ivan danicic

ivan said:
Hello, here is the jar file as attachment:
I am not sure if this will show up.
Ivan
If you can get a displayed picture from this then pressing 'a' or 'b'
should rotate it.
Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top