| | |
Cannot Find File Exception
![]() |
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
Okay im working on this game and all the code was in JSE 1.2 i just updated to that new package with the NetBeans IDE 5.0 and wh atnot inside it which is very nifty actually problem is all of my code when put into project files wont find any files, i tried moving the file folders into the class compiled folder, and the dist folders so that they would be in the same folder still i get this
the code referenced is this
could anyone please give me a little help with this i am not familiar with Java and i am trying to learn this as i go its a new language for me and i really could use help you can email me or reply here at <<email snipped>>
Java Syntax (Toggle Plain Text)
java.io.FileNotFoundException: ..\log\server.log (The system cannot find the path specified) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at DSpiresServer.startServer(DSpiresServer.java:200) at DSpiresServer.run(DSpiresServer.java:123)
the code referenced is this
Java Syntax (Toggle Plain Text)
// Cycle error log save for (int i=savelog-1;i>0;i--) { afile=new File("../log/error.log_"+i); if (afile.exists()) { bfile=new File("../log/error.log_"+(i+1)); afile.renameTo(bfile); } } afile=new File("../log/error.log"); bfile=new File("../log/error.log_1"); afile.renameTo(bfile); FileOutputStream fos = new FileOutputStream(new File("../log/server.log")); FileOutputStream fos2 = new FileOutputStream(new File("../log/error.log")); if (LOG_COMMANDS) commandLog = new PrintStream(new FileOutputStream(new File("..../log/commands.log"))); System.setErr(new PrintStream(fos2)); System.setOut(new PrintStream(fos)); } catch (IOException e) { e.printStackTrace(); }
could anyone please give me a little help with this i am not familiar with Java and i am trying to learn this as i go its a new language for me and i really could use help you can email me or reply here at <<email snipped>>
Last edited by ~s.o.s~; Aug 22nd, 2008 at 5:18 am. Reason: Keep it on site. Added code tags, learn to use them.
1. don't ask for emails.
2. use code tags for code
FileWriter
why are you changing using rename on a file you are writing, what is this code's purpose?
2. use code tags for code
FileWriter
why are you changing using rename on a file you are writing, what is this code's purpose?
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "-Albert Einstein
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "-Albert Einstein
I would suggest to look at this class: Logger
And search tutorials or examples, since you are interesting in log files
And search tutorials or examples, since you are interesting in log files
Check out my New Bike at my Public Profile at the "About Me" tab
![]() |
Similar Threads
- Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error (Java)
- File not closing (C++)
- Open a text file from another project (VB.NET)
- I need help with a Security Exception (ASP.NET)
- Reading from a file to fill an array (Java)
- HighJackThis File Log, Help Needed. (Viruses, Spyware and other Nasties)
- Downloading music (Windows NT / 2000 / XP)
- getting a nullpointer exception (Java)
- Exception messages reappears constantly! (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Please help me to print this triangle shape using Java loops
- Next Thread: java platform game
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class clear client code compile compiler component database development digit eclipse equation error event formatingtextintooltipjava fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list main map method methods mobile myregfun netbeans nonstatic notdisplaying openjavafx pearl problem program project qt recursion repositories scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver state storm string superclass swing system thread threads tree variablebinding windows xor






