Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 19th, 2012, 05:06 PM
Registered User
Points: 43, Level: 1
Points: 43, Level: 1 Points: 43, Level: 1 Points: 43, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #2 (permalink)  
Old February 23rd, 2012, 04:55 PM
Registered User
Points: 43, Level: 1
Points: 43, Level: 1 Points: 43, Level: 1 Points: 43, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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'


========================================
Reply With Quote
The Following User Says Thank You to MRGLENN For This Useful Post:
Cristina (February 24th, 2012)
  #3 (permalink)  
Old February 24th, 2012, 03:55 AM
Authorized User
Points: 159, Level: 3
Points: 159, Level: 3 Points: 159, Level: 3 Points: 159, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Location: Romania
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.