| | |
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
I murdered thousands for the Emperor and he gave me nothing except his damning silence. Now his lapdogs yap for every life I take, while the gods promise me the galaxy.
- Svane Vulfbad -
- Svane Vulfbad -
![]() |
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
Views: 2206 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Java
access android api apple applet application arguments array arrays automation binary c++ chat class classes client code combobox compiler component converter coordinates data database db design detection draw eclipse error event exception fast file fractal game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inheritance input integer interface j2me java jni jpanel jtable jtextfield julia linux list loop map method methods mobile netbeans newbie number object objects oracle os pattern phone pixel print problem program programming project read recursion regex remote remove robot scanner screen search server set size sms socket string swing test text threads timer transfer tree windows






