wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes can't able to write in file  & Path class not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can Watch "can New topic
Author

can't able to write in file & Path class not found

pradipta kumar rout
Ranch Hand

Joined: Sep 13, 2010
Posts: 43
Sir,
I have two problems
1.
I am reading a webpage using URL class and want to write it on a page usin a function. my code as follow



but it is not working can any one tell me what is the problem in this snippet


2.
I am having jdk 6 but unable to use Path class to create a file and to use it.
also Path class api also not found .

I unable to cereate a file by usin Path class

so please help me.

Thank you
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2850
    
  11

Please UseCodeTags . It will make your code much easier to read. I can't see what might be wrong though. It would help if you also posted what was not working about it, whether that's a thrown exception, or just no output.

I had actually never heard of the Path class, but with a little research I found that it's being introduced to the java.nio.file package in Java 7. That unfortunately means you can't use it in Java 6.
pradipta kumar rout
Ranch Hand

Joined: Sep 13, 2010
Posts: 43
Sir,
my following code creates a file cc.txt but the string is not written there.

kindly rectify the code or suggest me what to do.my above program also create a file but not able to write any string over the file.

Thank you
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4531
    
    5

Is it really so difficult to UseCodeTags ?

Read the API for BufferedWriter. All of it. It's not that large.


luck, db
There are no new questions, but there may be new answers.
 
Don't get me started about those stupid light bulbs.
 
subject: can't able to write in file & Path class not found