Results 1 to 4 of 4

Thread: Java:FileNotFoundException

  1. #1
    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)

  2. #2
    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.

  3. #3
    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.

  4. #4
    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.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Replies: 7
    Last Post: 06-11-2011, 11:07 PM
  3. Comparison between core java and advanced java
    By Prashobh Mallu in forum Software Development
    Replies: 5
    Last Post: 19-01-2010, 10:57 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,661,497.51083 seconds with 17 queries