Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.15 seconds.

  1. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    Sorry, that's not right, and it's pretty easy to test, which we should have done sooner.

    I create a project in eclipse. In the src directoy, I put an image file named Duke.png. I also create a...
  2. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    I'm not convinced the URLs were ever really your actual problem- I think your problem was confusing absolute and relative paths. Anything that starts with a / is an absolute path. Plus the...
  3. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    Capitalization doesn't matter on linux; it does on Windows. Not sure about mac.

    But reading aussiemcgr's advice makes sense. Either try his approach or use the getResourceAsStream() method.
  4. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    Can you take a screenshot of your directory hierarchy in eclipse so we know exactly where everything is located?

    If your multimedia folder is indeed inside your src folder, and that multimedia...
  5. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    Try changing this line:


    this.getClass().getResource(iconName);


    To this:


    this.getClass().getClassLoader().getResource(iconName);
  6. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    Your jar doesn't have a bin folder. It doesn't have anything above the src folder. So using ../multimedia doesn't really make any sense in the jar.



    You're calling the method correctly. It's...
  7. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    Here's the easiest way to accomplish this:

    Step 1: Put your multimedia folder inside your src folder. It should be at the same level as any packages you have declared, or any classes with the...
  8. Re: Program running okay in Eclipse, not running okay when exported as JAR.

    You can use the command prompt to view the contents of the jar: Viewing the Contents of a JAR File (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)

    Are the images inside the...
Results 1 to 8 of 8