Results 1 to 8 of 8
  1. #1
    minime12358 is offline Member
    Join Date
    Jul 2010
    Posts
    21
    Rep Power
    0

    Default referencing files in .exe

    With a current project, I am using scanners and filewriters on, text files, and I am opening wav files, gif files, and batch files all in the same folder. It has been working, but I made a jar, and then a .exe file from the jar. The text files work fine, but the gif, batch, and wave files are not being opened. Any help would be appreciated.

    Thanks.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    Are the files within the jar, or in the same folder as the exe? How are you opening the files? Code helps

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    then a .exe file from the jar
    What does that do to the classpath?
    What remains of the JVM when a jar is made into a .exe?

  4. #4
    minime12358 is offline Member
    Join Date
    Jul 2010
    Posts
    21
    Rep Power
    0

    Default

    I actually figured out what the problem was. Basically, I was referencing things like "blah.txt". If I have a folder with my exe file in it, it cant find blah.txt, so I had to put all the other stuff outside the exe.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Another reason not to create an exe.

  6. #6
    minime12358 is offline Member
    Join Date
    Jul 2010
    Posts
    21
    Rep Power
    0

    Default

    Actually, I needed to. I didnt know how to make a jar file that would execute with a click. My brother is autistic, and his school (of like 15) couldnt find a timer to use, and they needed a simple click file, so I made a exe. I ended up making an installer out of it so that the files all downloaded correctly.

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    make a jar file that would execute with a click
    That's a OS thing. I have all my jar files start with a double click. I think there is an OS setting that will start/execute a program with a single click vs a double click.
    Also you can create shortcuts with a command-line to start the execution of a jar file.

    I'm on WinXP. I'm sure it can also be done on linux. Don't know about the Mac

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,525
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by minime12358 View Post
    Actually, I needed to. I didnt know how to make a jar file that would execute with a click. My brother is autistic, and his school (of like 15) couldnt find a timer to use, and they needed a simple click file, so I made a exe. I ended up making an installer out of it so that the files all downloaded correctly.
    When/if you find the time, read up on MANIFEST.MF; it's a small file in your .jar that tells the JVM what class is supposed to start your application and a lot more. Associate the .jar extension with the javaw command and you're in business; there's no need for those .exe files.

    kind regards,

    Jos

Similar Threads

  1. Using weak referencing to gc listeners.
    By MartinR in forum New To Java
    Replies: 0
    Last Post: 05-29-2010, 11:37 PM
  2. Referencing Image Locations within Eclipse
    By haroldjclements in forum Eclipse
    Replies: 0
    Last Post: 03-23-2009, 02:34 PM
  3. Referencing a collection size in JSTL
    By jfputnam in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 10-08-2008, 04:02 PM
  4. [SOLVED] Referencing Variable within Loop
    By Judoon_Platoon in forum Java Applets
    Replies: 2
    Last Post: 05-22-2008, 11:54 AM
  5. Referencing JPanel Class
    By uncopywritable in forum New To Java
    Replies: 2
    Last Post: 08-12-2007, 01:31 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
  •