Wrox Programmer Forums
|
BOOK: Java Programming 24-Hour Trainer by Yakov Fain
This is the forum to discuss the Wrox book Java Programming 24-Hour Trainer by Yakov Fain; ISBN: 978-0-470-88964-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Java Programming 24-Hour Trainer by Yakov Fain section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2012, 05:06 PM
Registered User
 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 1 Time in 1 Post
Default Lesson 16 File I-O

Java File: FileInputStream.java on Page 164
and the Src Code File

gives IO Exception (File Not Found... abc.dat )

The File is Created & Located in the Src Folder of Eclipse.

Runs Fine with Another Compiler. Any Ideas
 
Old February 23rd, 2012, 04:55 PM
Registered User
 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 1 Time in 1 Post
Wink Problem Solved

Found the Problem to Not Reading Users File (abc.dat )

in : Eclipse (IDE)

WorkAround

1:Use: Notepad.exe or Similar File

to Create: abc.dat

2: Then Save to

a. Root Folder of Project

1. Not the Eclipse src Folder

b. Do the same for File: states.txt

It Must be Saved in Root Folder of : Leesson 16

Apparently Eclipse Does Not Read Users Files From
the .src Folder. Hope this Helps All


'MRGLENN'


========================================
The Following User Says Thank You to MRGLENN For This Useful Post:
Cristina (February 24th, 2012)
 
Old February 24th, 2012, 03:55 AM
Authorized User
 
Join Date: Feb 2012
Posts: 30
Thanks: 5
Thanked 4 Times in 4 Posts
Default

Worked for me when I used the full path name of the file, as follows:

Code:
myFile = new FileInputStream("C:\\Eclipse\\Cristina\\workspace\\CLesson16\\src\\abc.dat");
Also, you can create the text file in Eclipse as well, choosing New->File from the menu.

You can find in the book more details regarding the default current directory and how to find it out programmatically.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 7 Joakim BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 1 November 30th, 2011 11:16 AM
Lesson 4 Femi Sonuga BOOK: Knight's Microsoft Business Intelligence 24-Hour Trainer 0 November 25th, 2011 10:25 AM
Lesson 9 MTMike BOOK: Knight's Microsoft Business Intelligence 24-Hour Trainer 3 November 3rd, 2011 01:51 PM
Lesson 8 sergeySE BOOK: Java Programming 24-Hour Trainer by Yakov Fain 1 June 29th, 2011 09:49 AM
Chapter 16 Fig 16-11 krsouthern BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 July 8th, 2008 12:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.