Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

jar

Thread view: 
ivan danicic - 14 Mar 2007 11:21 GMT
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
Knute Johnson - 14 Mar 2007 19:12 GMT
> 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?

Signature

Knute Johnson
email s/nospam/knute/

ivan danicic - 14 Mar 2007 21:19 GMT
>> Hello all, I am trying to create an executable jar file from my JOGL
>> prog.
[quoted text clipped - 5 lines]
> 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
Knute Johnson - 15 Mar 2007 00:08 GMT
>>> Hello all, I am trying to create an executable jar file from my JOGL
>>> prog.
[quoted text clipped - 9 lines]
> 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.

Signature

Knute Johnson
email s/nospam/knute/

ivan danicic - 16 Mar 2007 14:30 GMT
>>>> Hello all, I am trying to create an executable jar file from my JOGL
>>>> prog.
[quoted text clipped - 12 lines]
> 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
Knute Johnson - 16 Mar 2007 17:39 GMT
>>>>> Hello all, I am trying to create an executable jar file from my JOGL
>>>>> prog.
[quoted text clipped - 18 lines]
> 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.

Signature

Knute Johnson
email s/nospam/knute/

ivan danicic - 18 Mar 2007 20:58 GMT
>>>>> Hello all, I am trying to create an executable jar file from my JOGL
>>>>> prog.
[quoted text clipped - 19 lines]
> 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
Knute Johnson - 19 Mar 2007 01:00 GMT
>>>>>> Hello all, I am trying to create an executable jar file from my JOGL
>>>>>> prog.
[quoted text clipped - 31 lines]
> 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.

Signature

Knute Johnson
email s/nospam/knute/

ivan danicic - 19 Mar 2007 13:27 GMT
>>>>>>> Hello all, I am trying to create an executable jar file from my JOGL
>>>>>>> prog.
[quoted text clipped - 20 lines]
> 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
Knute Johnson - 19 Mar 2007 16:48 GMT
>> 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,
[quoted text clipped - 11 lines]
> do it?
> Ivan

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

Signature

Knute Johnson
email s/nospam/knute/

ivan danicic - 15 Mar 2007 20:09 GMT
>>> Hello all, I am trying to create an executable jar file from my JOGL
>>> prog.
[quoted text clipped - 9 lines]
> 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
Knute Johnson - 16 Mar 2007 00:42 GMT
>>>> Hello all, I am trying to create an executable jar file from my JOGL
>>>> prog.
[quoted text clipped - 15 lines]
> with web start.
> Ivan

http://knutejohnson.com/classpath.html

Signature

Knute Johnson
email s/nospam/knute/

Andrew Thompson - 19 Mar 2007 13:50 GMT
..
> ..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.
Joshua Cranmer - 15 Mar 2007 00:51 GMT
> 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.
ivan danicic - 15 Mar 2007 11:41 GMT
>> Hello all, I am trying to create an executable jar file from my JOGL
>> prog.
[quoted text clipped - 5 lines]
> 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
Joshua Cranmer - 15 Mar 2007 22:38 GMT
>>> Hello all, I am trying to create an executable jar file from my JOGL
>>> prog.
[quoted text clipped - 7 lines]
> Hello, it is in the current directory.
> Ivan

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

I would recommend moving the jar file to the extensions directory, cf.
http://java.sun.com/docs/books/tutorial/ext/ for more information.
Knute Johnson - 16 Mar 2007 00:42 GMT
> 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.

Signature

Knute Johnson
email s/nospam/knute/

Andrew Thompson - 15 Mar 2007 11:48 GMT
> Hello all, I am trying to create an executable jar file from my JOGL prog.

JOGL projects are often launched using web start*.
You can then simply refer to the JOGL classes
as a JNLP based 'library' (which the JOGL
developers maintain).

* E.G.
<http://www.javasaver.com/testjs/jws/04/glclock.jnlp>

HTH

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.