Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 42
  1. #21
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    You can rename the .jar to .zip and have a look whether the resources are in it and what the path within the jar is.
    They are. The files folder in top level in the zip, as is the first part of my package name, "biz." The class file is in biz/mybiz/alpha/AlphaPlay.class. (Some tutorial I did said package names follow some similar convention.) root of the .zip also has META-INF folder and org folders. META-INF has a manifest.mf file.

    Manifest-Version: 1.0
    Rsrc-Class-Path: ./
    Class-Path: .
    Rsrc-Main-Class: biz.mybiz.alpha.AlphaPlay
    Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoa der
    Last edited by NotTooOld; 04-11-2013 at 11:05 AM.

  2. #22
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Launch Configuration

    You don't even have to do that.
    7Zip opens jar files as well as any other archive, and I expect other zip tools do as well.

    NotTooOld:
    An executable jar file does not use paths, since the classpath is defined in the manifest.
    The paths in Eclipse affect what gets mentioned in the jar file manifest, and the source folders affect what gets included in the jar file.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #23
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    You don't even have to do that.
    7Zip opens jar files as well as any other archive, and I expect other zip tools do as well.

    NotTooOld:
    An executable jar file does not use paths, since the classpath is defined in the manifest.
    The paths in Eclipse affect what gets mentioned in the jar file manifest, and the source folders affect what gets included in the jar file.
    In any case, since the resource files are in the jar, I shouldn't be messing with the build path thing. So why do you think this is not opening, and what can I do to fix it?

  4. #24
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Launch Configuration

    Logging is the only solution.
    Even if just System.out.println().
    Log everything in the problem area.
    It does mean (unless you use a proper loggin framework) launching from the command line.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #25
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    Logging is the only solution.
    Even if just System.out.println().
    Log everything in the problem area.
    It does mean (unless you use a proper loggin framework) launching from the command line.
    To be clear, you mean launch my class file (the one located in my eclipse project directory) using the command line. That should be no problem, but I'm not clear on what to "log." when I run the class file in before jarring it, everything works fine.

  6. #26
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    what I get from the command line:
    Launch Configuration-cmdlineerror.gif

    So what the heck does that mean?

  7. #27
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Launch Configuration

    No, stick debugging or loging code int here.
    Even just System.out.println() statements around the problem area.
    Print everything you can think of that might help identify the problem...paths used for example.

    And run from the jar file, since that's where you are hitting problems.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #28
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    No, stick debugging or loging code int here.
    Even just System.out.println() statements around the problem area.
    Print everything you can think of that might help identify the problem...paths used for example.

    And run from the jar file, since that's where you are hitting problems.
    ok. How do I edit inside the jar file? I need to edit outside and export a new runnable (ha ha ha ha) jar file?
    Last edited by NotTooOld; 04-11-2013 at 12:55 PM.

  9. #29
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    You don't. Edit the java files, recompile and jar them again.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  10. #30
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    You don't. Edit the java files, recompile and jar them again.
    Launch Configuration-cmdlineerror.gif
    Strange that the 3rd ImageIcon seems to be the problem...

    Here is where they are declared:
    Java Code:
    private URL imgLeft = AlphaPlay.class.getResource("/files/ZZOpen/LeftHand.gif");
    private URL imgTop = AlphaPlay.class.getResource("/files/ZZOpen/TopStart.gif");
    private URL imgRight = AlphaPlay.class.getResource("/files/ZZOpen/report.gif");
    Last edited by NotTooOld; 04-11-2013 at 01:34 PM.

  11. #31
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    The file name is really report.gif? Not Report.gif or some other typo? If the other two images are loaded fine, the path is OK.

    Also 67ImageRight could be null, causing this exception.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  12. #32
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Holy porkchops! the Report.gif was not Capitalized in the declaration... I will check all capitalization carefully and get back here. I'm still getting an error, but the JFrame is opening now... just no sound file playing.

    java.lang.IOException: mark/reset not supported
    Last edited by NotTooOld; 04-11-2013 at 01:57 PM.

  13. #33
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    You don't. Edit the java files, recompile and jar them again.
    Is this error because I add an AudioLineListener? no, it seems to be this line: Clip clip = AudioSystem.getClip();

    java.lang.IOException: mark/reset not supported

    no, I think now, after three runs, it is this line: AudioInputStream audio = AudioSystem.getAudioInputStream(inStr);
    Java Code:
    InputStream inStr = AlphaPlay.class.getResourceAsStream(sound);
    				System.out.println("line 417");///////////////////////////////////////////
    				AudioInputStream audio = AudioSystem.getAudioInputStream(inStr);
    				System.out.println("line 419");///////////////////////////////////////////
    		        Clip clip = AudioSystem.getClip();
    		        System.out.println("line 421");///////////////////////////////////////////
    		        clip.addLineListener(this);
    		        clip.open(audio);
    		        clip.start();
    Line 417 is always the last one to print
    Launch Configuration-cmdlineerror.gif
    Last edited by NotTooOld; 04-11-2013 at 02:39 PM.

  14. #34
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    Could be. The API doc state that getAudioInputStream throws an IOException. Can you post the full stack trace, please?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  15. #35
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Launch Configuration

    You want a BufferedInputStream, which has that functionality.
    To get one just wrap your resource stream in a BIS:
    Java Code:
    BufferedInputStream bufferedSound = new BufferedInputStream(AlphaPlay.class.getResourceAsStream(sound));
    The docs do mention this, but don't give an example of what to wrap it in.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  16. #36
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    Could be. The API doc state that getAudioInputStream throws an IOException. Can you post the full stack trace, please?
    In Eclipse there is no stack trace to print. I get no errors

  17. #37
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    You want a BufferedInputStream, which has that functionality.
    To get one just wrap your resource stream in a BIS:
    Java Code:
    BufferedInputStream bufferedSound = new BufferedInputStream(AlphaPlay.class.getResourceAsStream(sound));
    The docs do mention this, but don't give an example of what to wrap it in.
    How do you find this info so fast?? thank you!

  18. #38
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    You want a BufferedInputStream, which has that functionality.
    To get one just wrap your resource stream in a BIS:
    Java Code:
    BufferedInputStream bufferedSound = new BufferedInputStream(AlphaPlay.class.getResourceAsStream(sound));
    The docs do mention this, but don't give an example of what to wrap it in.
    that line should replace this one, yes?
    InputStream inStr = AlphaPlay.class.getResourceAsStream(sound);

  19. #39
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Launch Configuration-cl.gif
    Quote Originally Posted by Tolls View Post
    You want a BufferedInputStream, which has that functionality.
    To get one just wrap your resource stream in a BIS:
    Java Code:
    BufferedInputStream bufferedSound = new BufferedInputStream(AlphaPlay.class.getResourceAsStream(sound));
    The docs do mention this, but don't give an example of what to wrap it in.
    That works like a charm! thanks much!
    Launch Configuration-cmdlineerror.gif

  20. #40
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    Could be. The API doc state that getAudioInputStream throws an IOException. Can you post the full stack trace, please?
    Thanks so much for all your help!Launch Configuration-cl.gif

    Launch Configuration-cmdlineerror.gif

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 08-23-2013, 10:18 AM
  2. Launch Jar from in application
    By hardcorebadger in forum New To Java
    Replies: 3
    Last Post: 01-25-2011, 06:03 AM
  3. Create a launch configuration file
    By juza in forum Eclipse
    Replies: 0
    Last Post: 03-24-2010, 12:55 PM
  4. Launch configuration
    By skittle in forum Eclipse
    Replies: 0
    Last Post: 02-28-2010, 11:57 PM
  5. Launch Error
    By roughjj in forum Eclipse
    Replies: 1
    Last Post: 10-30-2009, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •