Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:13:44+00:00 2026-06-07T10:13:44+00:00

I have been working on a project in Eclipse that requires me to open

  • 0

I have been working on a project in Eclipse that requires me to open a file. It’s working as expected. I imported my project into Netbeans just to check it out but when run, the file can’t be opened. I think a screenshot would be most helpful in this case:

screenshot of the problem in Netbeans

Any idea what the issue is? I’ve even explicitly specified the run directory in the project properties and that still doesn’t work.

Additional Info:

  • I just remembered that I’m using the JDK 1.6 in Eclipse but Netbeans is using the JDK 1.7 — is file path resolution handled differently between the two platforms?

Also, as suggested by a few users, I added in my catch block:

System.err.println(new File(inFileName).getAbsolutePath();

Which, as it should, returns:

C:\Users\David\Dev\projects\Autocuration\pearltrees_export_02-07-2012.rdf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:13:46+00:00Added an answer on June 7, 2026 at 10:13 am

    After attempting to construct the URI manually,

    System.out.println(new File(System.getProperty("user.dir")).toURI().resolve(inFileName));
    

    I got the following exception:

    Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in path at index 32: pearltrees_export_02-07-2012.rdf

    Considering there is no 32nd character, I assume the printStackTrace method must trim the string obtained from the exception message before printing.

    Whatever the case, it appears that Netbeans parses Run arguments using the ‘ ‘ (space) character as a separator. However, it also includes that space when it passes the arguments to the main method. In other words, I was trying to open:

    "pearltrees_export_02-07-2012.rdf "

    rather than:

    "pearltrees_export_02-07-2012.rdf"

    Simply trimming argument fixes the problem:

    inStream = new FileInputStream(new File(inFileName.trim()));
    

    Anyway, I cannot find any documentation stating this is the intended behavior as it is certainly different from how the java binary behaves (and any other editors I know of). For this reason I consider this a bug, and I submitted a bug report:

    http://netbeans.org/bugzilla/show_bug.cgi?id=215429

    I guess we’ll see what the Netbeans fellows have to say..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just been working on my android project in eclipse and all of
Hey so I have been working on a project that I want to be
I have an Eclipse project I've been working on for some time now, and
I have been working on packing a project lately but it has turned into
Possible Duplicate: Auto refresh eclipse project upon folder update I have been working with
I have a large project I'm working on (using Eclipse) that uses the 1.5
I have been working on a project that has common bits of functionality, specifically
I have been working on a project in C# (.net4). Project pretty much allows
I have been working on a project on and off, but I haven't touched
Situation I have been working on a project lately where the UI development seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.