Hey guys, I hope you can help me out on that issue.
In order to run java code in Sublime Text 3 I followed the instructions to edit JavaC.sublime-build. If I run my code in ST3 now I get the error message that my main class couldn’t be found or loaded. So I tried to combine the instruction above with this, adding the jdk path to JavaC.sublime-build. But I still can’t run java code with ST3. I’ve read something about classpath but I thought it would be solved with that extra line from the second source, referring to the jdk bin directory.
What I’m doing wrong?
Thanks for your help.
I’m running Sublime Text 3 on Mac OS X El Capitan.
Edit: I have edited the JavaC.sublime-buid to:
`{
“shell_cmd”: “javac “$file””,
“path”: “/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin:$PATH”,
“file_regex”: “^(…?):([0-9]):?([0-9]*)”,
“selector”: “source.java”,
"variants":
[
{
"name": "Run",
"shell_cmd": "java $file_base_name"
}
]
}`
And I get: > Error: couldn’t find or load main class startJava
[Finished in 0.7s with exit code 1]
[shell_cmd: java startJava]
[dir: /Users/dkin/Documents/Coding/java]
[path: /usr/bin:/bin:/usr/sbin:/sbin]