Eclipse jar file problem

Discussion in 'Java' started by MstrOfPppts, Oct 21, 2008.

  1. MstrOfPppts

    MstrOfPppts

    Joined:
    Oct 21, 2008
    Messages:
    1
    Greetings,

    I have this problem when creating a .jar file of my project. In Eclipse I have my project working and when exporting it as a .jar file, sounds won't work.

    In eclipse this is the folder structure:
    Pname
    --src
    ----(default package)
    ------Main.java
    ----sound
    ------sound1.wav

    This is how I call my sound file in Main.java:

    String filePath = System.getProperty("user.dir")+"\\src\\sound\\";
    playAudioFile(filePath+"sound1.wav");

    It works perfectly in eclipse, but after I export this into jar, the sound doesn't work. I assume I have to change the path somehow, but don't know how.

    If I copy source files onto let's say D:\ and compile with javac, I have to delete the src\\ part from the filePath. And the java Main works great. But even here by creating the .jar file with jar cf ... sound doesn't work.

    All I have noticed is that not jar command nor eclipses' export don't create the META-INF/INDEX.LIST file which I saw in a working .jar file. I tried adding it manually but with no success ...

    Any suggestions would be great!

    Best regards
    Last edited: Oct 21, 2008
    MstrOfPppts, Oct 21, 2008
    #1
    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. Arnold Peters
    Replies:
    0
    Views:
    553
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,688
    muttley
    Oct 20, 2005
  3. puzzlecracker
    Replies:
    2
    Views:
    5,101
    Jean-Francois Briere
    Dec 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,722
    Roedy Green
    Feb 14, 2006
  5. wong_powah@yahoo.ca
    Replies:
    0
    Views:
    407
    wong_powah@yahoo.ca
    Mar 27, 2008
Loading...

Share This Page