My error is:
- Code: Select all
> -----------OUTPUT-----------
> This program will calculate the average for the given number of student's marks
> How many students are in the class?
> Exception in thread "main" java.lang.NumberFormatException: null
> at java.lang.Integer.parseInt(Unknown Source)
> at java.lang.Integer.parseInt(Unknown Source)
> at Unit4ClassAverage.main(Unit4ClassAverage.java:33)
> [Finished in 0.8s with exit code 1]
The block of code responsible for this, I'm guessing is:
- Code: Select all
System.out.println("This program will calculate the average for the given number of student's marks");
System.out.println("How many students are in the class?");
strInput = br.readLine();
intStudents = Integer.parseInt(strInput);
My JavaC.sublime-build file looks as follows:
- Code: Select all
{
"cmd": ["runJava.bat", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java"
}
and my runJava.bat file looks as follows:
- Code: Select all
@ECHO OFF
cd %~dp1
ECHO Compiling %~nx1.......
IF EXIST %~n1.class (
DEL %~n1.class
)
javac %~nx1
IF EXIST %~n1.class (
ECHO -----------OUTPUT-----------
java %~n1
)
which is located in my "C:\Program Files (x86)\Java\jdk1.7.0_05\bin" folder.
Any help would be appreciated!
The full code can be seen http://pastebin.com/d5QDqMbJ