holycow02
04-08-2008, 02:12 AM
This code throws a FileNotFoundException. The file, "primary.input" is in the project folder which is in the same directory as all of the class files and java files.
package proj3;
import java.util.*;
import java.io.*;
class Main
{
public static void main(String[]args) throws FileNotFoundException
{
File fl = new File("primary.input");
FileReader f = new FileReader(fl);
BufferedReader br = new BufferedReader(f);
Stackz s;
try
{
while(br.ready())
{
String theString = br.readLine();
s = new Stackz(theString);
}
}
catch(IOException e){}
}
}
and here is the error the runtime gets:
----jGRASP exec: java proj3.Main
Exception in thread "main" java.io.FileNotFoundException: primary.input (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileReader.<init>(FileReader.java:55)
at proj3.Main.main(Main.java:13)
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
I can give the other classes if they are needed, so let me know if that will help.
Thanks
package proj3;
import java.util.*;
import java.io.*;
class Main
{
public static void main(String[]args) throws FileNotFoundException
{
File fl = new File("primary.input");
FileReader f = new FileReader(fl);
BufferedReader br = new BufferedReader(f);
Stackz s;
try
{
while(br.ready())
{
String theString = br.readLine();
s = new Stackz(theString);
}
}
catch(IOException e){}
}
}
and here is the error the runtime gets:
----jGRASP exec: java proj3.Main
Exception in thread "main" java.io.FileNotFoundException: primary.input (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileReader.<init>(FileReader.java:55)
at proj3.Main.main(Main.java:13)
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
I can give the other classes if they are needed, so let me know if that will help.
Thanks