jar

Discussion in 'Java' started by ivan danicic, Mar 14, 2007.

  1. ivan danicic

    ivan danicic Guest

    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
     
    ivan danicic, Mar 14, 2007
    #1
    1. Advertising

  2. ivan danicic wrote:
    > 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?

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 14, 2007
    #2
    1. Advertising

  3. ivan danicic

    ivan danicic Guest

    Knute Johnson wrote:

    > ivan danicic wrote:
    >> 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?
    >

    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
     
    ivan danicic, Mar 14, 2007
    #3
  4. ivan danicic wrote:
    > Knute Johnson wrote:
    >
    >> ivan danicic wrote:
    >>> 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?
    >>

    > 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.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 14, 2007
    #4
  5. ivan danicic wrote:
    > 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.
     
    Joshua Cranmer, Mar 14, 2007
    #5
  6. ivan danicic

    ivan danicic Guest

    Joshua Cranmer wrote:

    > ivan danicic wrote:
    >> 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.

    Hello, it is in the current directory.
    Ivan
     
    ivan danicic, Mar 15, 2007
    #6
  7. On Mar 14, 9:21 pm, ivan danicic <> wrote:
    > 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.
     
    Andrew Thompson, Mar 15, 2007
    #7
  8. ivan danicic

    ivan danicic Guest

    ivan danicic wrote:

    > Knute Johnson wrote:
    >
    >> ivan danicic wrote:
    >>> 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?
    >>

    > 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
     
    ivan danicic, Mar 15, 2007
    #8
  9. ivan danicic wrote:
    > Joshua Cranmer wrote:
    >
    >> ivan danicic wrote:
    >>> 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.

    > 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.
     
    Joshua Cranmer, Mar 15, 2007
    #9
  10. ivan danicic wrote:
    > ivan danicic wrote:
    >
    >> Knute Johnson wrote:
    >>
    >>> ivan danicic wrote:
    >>>> 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?
    >>>

    >> 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
    >
    >


    http://knutejohnson.com/classpath.html

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 15, 2007
    #10
  11. Joshua Cranmer wrote:
    >
    > 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.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 15, 2007
    #11
  12. ivan danicic

    ivan danicic Guest

    Knute Johnson wrote:

    > ivan danicic wrote:
    >> Knute Johnson wrote:
    >>
    >>> ivan danicic wrote:
    >>>> 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?
    >>>

    >> 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.
    >

    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
     
    ivan danicic, Mar 16, 2007
    #12
  13. ivan danicic wrote:
    > Knute Johnson wrote:
    >
    >> ivan danicic wrote:
    >>> Knute Johnson wrote:
    >>>
    >>>> ivan danicic wrote:
    >>>>> 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?
    >>>>
    >>> 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.
    >>

    > 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.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 16, 2007
    #13
  14. ivan danicic

    ivan danicic Guest

    "ivan danicic" <> wrote in message
    news:5_wKh.86648$...
    > Knute Johnson wrote:
    >
    >> ivan danicic wrote:
    >>> Knute Johnson wrote:
    >>>
    >>>> ivan danicic wrote:
    >>>>> 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?
    >>>>
    >>> 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.
    >>

    > 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
     
    ivan danicic, Mar 18, 2007
    #14
  15. ivan danicic wrote:
    >
    > "ivan danicic" <> wrote in message
    > news:5_wKh.86648$...
    >> Knute Johnson wrote:
    >>
    >>> ivan danicic wrote:
    >>>> Knute Johnson wrote:
    >>>>
    >>>>> ivan danicic wrote:
    >>>>>> 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?
    >>>>>
    >>>> 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.
    >>>

    >> 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
    >


    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.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 19, 2007
    #15
  16. ivan danicic

    ivan danicic Guest

    Knute Johnson wrote:

    > ivan danicic wrote:
    >>
    >> "ivan danicic" <> wrote in message
    >> news:5_wKh.86648$...
    >>> Knute Johnson wrote:
    >>>
    >>>> ivan danicic wrote:
    >>>>> Knute Johnson wrote:
    >>>>>
    >>>>>> ivan danicic wrote:
    >>>>>>> Hello all, I am trying to create an executable jar file from my JOGL
    >>>>>>> prog.
    >>>>>> SNIP
    >>> 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
    >>

    >
    > 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
     
    ivan danicic, Mar 19, 2007
    #16
  17. On Mar 16, 6:09 am, ivan danicic <> wrote:
    ...
    > ..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.
     
    Andrew Thompson, Mar 19, 2007
    #17
  18. ivan danicic wrote:
    >> 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


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

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 19, 2007
    #18
  19. ivan danicic

    ivan danicic Guest

    ivan danicic wrote:

    > Knute Johnson wrote:
    >
    >> ivan danicic wrote:
    >>>> 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

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

    > 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
     
    ivan danicic, Mar 19, 2007
    #19
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Alan Farrell
    Replies:
    6
    Views:
    9,761
    Andrew Thompson
    Jan 9, 2004
  2. Arnold Peters
    Replies:
    0
    Views:
    643
    Arnold Peters
    Jan 5, 2005
  3. muttley
    Replies:
    0
    Views:
    2,803
    muttley
    Oct 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,883
    Roedy Green
    Feb 14, 2006
  5. Arnold Peters
    Replies:
    0
    Views:
    709
    Arnold Peters
    Jan 5, 2005
Loading...

Share This Page