Results 1 to 3 of 3
  1. #1
    pranav13's Avatar
    pranav13 is offline Member
    Join Date
    Oct 2008
    Greater Hyderabad
    Rep Power

    Default cudnt run jar file builded in netbeans!

    hi all,
    im new to java. i have developed a small desktop app using swings. it is working fine in the IDE but when running the jar file, it is giving error.
    problem might be of the path of txt file i have read in the program.
    please tell me how to refer a local file in the jar file.
    i kept a txt file in the resources folder in the jar file and want to access it from my java file.
    i have used getClass().getResource("/xyz/resources/abc.txt");
    but it is not working properly after building jar.

    any suggestions/solutions is appreciated.

    thanks in advance!

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    it is giving error.
    Please copy and paste full text of error here.
    In the path to the resource, leave off the leading /

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    pranav13, you have discuss quite similar question in another thread. So it's better to stick with one, actually with the other one. Because lots of replays you can find there.

Similar Threads

  1. help with netBeans
    By the godfather01 in forum NetBeans
    Replies: 11
    Last Post: 02-01-2009, 05:48 PM
  2. file not found outside of Netbeans
    By annie in forum NetBeans
    Replies: 0
    Last Post: 06-21-2008, 11:10 PM
  3. NetBeans 5.5.1 Help.
    By padutch2 in forum New To Java
    Replies: 6
    Last Post: 12-03-2007, 04:01 AM
  4. netbeans 64 bit
    By caspermel in forum NetBeans
    Replies: 1
    Last Post: 06-26-2007, 11:29 PM
  5. About using netbeans
    By yuchuang in forum NetBeans
    Replies: 3
    Last Post: 05-27-2007, 09:06 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