Results 1 to 8 of 8
  1. #1
    PMurph is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default App runs on one system but not the other?

    Hi, I'm new here so I hoping I'm posting this in the right forum. So I have written a small text file parsing program (code is in attached doc) and it runs fine on MacBook when compiled with Dr Java. However, when i compile it into a jar file using Eclipse on my desktop it throws a FileNotFoundException even when file path is correct. Desktop is running Windows 7 although I don't think OS should matter.
    Attached Files Attached Files

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    PMurph is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    this is the message that is sent by the FileNotFoundException through the getMessage() function:

    C:\test1.txt (The system cannot find the file specified)

  4. #4
    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

    Are you sure that the file is exist in both system? Actually in the system that you end up with an error.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  6. #6
    PMurph is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    Yes, the file is located on both systems. It is located at C:\ on the system that I get the error message. Also I am using backslash, but even if I use forward slash it changes it to backslash when I get the Error message.

  7. #7
    PMurph is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    Found out what the issue was. The test file was saved as test1.txt.txt and it wasn't showing up on file explorer.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Jar file wont run but runs in netbeans
    By ArmenBaba in forum NetBeans
    Replies: 14
    Last Post: 08-24-2010, 06:04 PM
  2. vm runs through jdialog directly to jframe
    By j2me64 in forum AWT / Swing
    Replies: 5
    Last Post: 01-31-2010, 11:27 PM
  3. Code compiles in/runs in IDE but not on UNIX system
    By Unclejunebug in forum New To Java
    Replies: 7
    Last Post: 10-08-2009, 09:35 AM
  4. [SOLVED] App runs only in IDE
    By hannehomuth in forum Advanced Java
    Replies: 4
    Last Post: 07-15-2009, 07:41 PM
  5. Program Runs in NetBEans but Not in cmd
    By MeathUltra in forum NetBeans
    Replies: 1
    Last Post: 12-09-2008, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •