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

    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
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    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
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

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