Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Issue with file I/O integration for compilation
Issue with file I/O integration for compilation [message #1193905] Mon, 18 November 2013 08:28 Go to next message
Andrey Gaganov is currently offline Andrey GaganovFriend
Messages: 2
Registered: November 2013
Junior Member
Hi,

I'm new to the Eclipse IDE, and I need some help. I have a project where I import a couple of libraries and compile a java class file. The only thing missing is the inclusion of an output file (working-draft.txt). Here's what I got on the console:

Exception in thread "main" java.io.FileNotFoundException: working-draft.txt (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at Main.main(Main.java:33)

So, I tried to create the blank output file with Eclipse and refreshed and ran the project, but the console spits out the same errors.

What do I have to do to let the program find the output file?

Any help would be appreciated.

- Andrey.
Re: Issue with file I/O integration for compilation [message #1194514 is a reply to message #1193905] Mon, 18 November 2013 14:52 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 11/18/2013 05:53 AM, Andrey Gaganov wrote:
> Hi,
>
> I'm new to the Eclipse IDE, and I need some help. I have a project where
> I import a couple of libraries and compile a java class file. The only
> thing missing is the inclusion of an output file (working-draft.txt).
> Here's what I got on the console:
>
> Exception in thread "main" java.io.FileNotFoundException:
> working-draft.txt (No such file or directory)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:146)
> at Main.main(Main.java:33)
>
> So, I tried to create the blank output file with Eclipse and refreshed
> and ran the project, but the console spits out the same errors.
>
> What do I have to do to let the program find the output file?
>
> Any help would be appreciated.
>
> - Andrey.

This is because of how Java file I/O works; it's nothing to do with
Eclipse. I would suggest that you write another sample program that
creates a file, then go find that file in your filesystem. This will
help you get a feeling for how this works and where you should place
working-draft.txt such that you can find and open it from the program
you're trying to get working.
Re: Issue with file I/O integration for compilation [message #1195035 is a reply to message #1194514] Mon, 18 November 2013 20:33 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4492
Registered: July 2009
Senior Member

The Java Application launcher allows you to set the working directory on the Arguments tab. The default is the same location as the project, which I'm guessing is not what you expected. You can change it there.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Issue with file I/O integration for compilation [message #1197496 is a reply to message #1195035] Tue, 19 November 2013 23:29 Go to previous message
Andrey Gaganov is currently offline Andrey GaganovFriend
Messages: 2
Registered: November 2013
Junior Member
Thank you all. Is there a way to mark this thread as solved?
Previous Topic:Trouble reading these forums as a newsgroup
Next Topic:gdk_screen_get_resolution
Goto Forum:
  


Current Time: Thu Sep 26 18:03:44 GMT 2024

Powered by FUDForum. Page generated in 0.08845 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top