Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 21-09-2009
Member
 
Join Date: Oct 2008
Posts: 76
Java:FileNotFoundException

When I tried to run .javac files in the java environment the compiler gives me the following error message, the strange problem is that it compiles .java file but when I run the .javac file it gives me following error.

java.io.FileNotFoundException: /sites/myproject/reports/jrxml/Test1.txt (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:179)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:70)
Reply With Quote
  #2  
Old 21-09-2009
Member
 
Join Date: Mar 2008
Posts: 258
Re: Java:FileNotFoundException

This exception will be thrown by the FileInputStream, FileOutputStream, and RandomAccessFile constructors when a file with the specified pathname does not exist. Check whether you have set the file path as C:\\Documents and Settings\\Collin\\My Documents\\NetBeansProjects\\Yahtzee\\src\\yahtzee path in the classpath? It will also be thrown by these constructors if the file does exist but for some reason is inaccessible.
Reply With Quote
  #3  
Old 21-09-2009
Member
 
Join Date: Feb 2006
Posts: 159
Re: Java:FileNotFoundException

public FileNotFoundException(String s)

Constructs a FileNotFoundException with the specified detail message. The string s can be retrieved later by the Throwable.getMessage() method of class java.lang.Throwable. It is in the same directory as my class files. I can get the code to run if I use the entire (absolute)path name with double backslaches.
Reply With Quote
  #4  
Old 21-09-2009
Member
 
Join Date: Feb 2008
Posts: 137
Re: Java:FileNotFoundException

Another cause for this message, as I discovered on a Windows box, is that when you Install Continuum as a service it sucks in information about the JDK it is using and encapsulates it as one of the parameters in the service launch. This should output the system-dependent, unique path to where the virtual machine believes the file is, so you can see where the discrepancy is. If you subsequently substitute a newer (or older) JDK the service will no longer start.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Java:FileNotFoundException"
Thread Thread Starter Forum Replies Last Post
Java Auto Updater wants me to update java everyday in Windows 7 minajoh Windows Software 4 04-09-2013 11:04 PM
Getting ?system.io.filenotfoundexception? error message while playing Sonic Generations Tufan Video Games 7 06-11-2011 11:07 PM
Comparison between core java and advanced java Prashobh Mallu Software Development 5 19-01-2010 10:57 AM
Link List Example in Java Sample program in Java trickson Software Development 2 04-08-2009 08:23 PM


All times are GMT +5.5. The time now is 12:02 PM.