My Java bin is added to the path, still it's not able to find the javac I think.
The thing works fine in eclipse IDE.
public class testing {
public static void main(String[] args) {
System.out.println("hi");
}
}
Below is the error from sublime text 2. Removed some intel path otherwise path was too long.
[Error 2] The system cannot find the file specified
[cmd: [u'javac', u'C:\\Users\.......\testing.Java']]
[dir: C:\Users.....
[path: C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jre1.8.0_45\bin;]
[Finished]
If I run it in Sublime text 3 then the error is below.
'javac' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.0s with exit code 1]
I even tried the custom build but the error shown is same, below is the custom build.
MyJava.sublime-build
{
"cmd": ["javac", "$file_name", "&&", "java" ,"$file_base_name"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"path" : "C:\\Program Files\\Java\\jre1.8.0_45\\bin",
"selector": "source.java",
"shell":true
}
Please help due to this I haven't been using Sublime text and continuing with Eclipse but thought let me try again.
Below is my Java folder. As suggested I added jdk to the path.
But now error changes to below.
javac: invalid flag: C:\........GitHub\HackerRank\testing.Java
Usage: javac <options> <source files>
use -help for a list of possible options
[Finished in 0.3s with exit code 2]