Recently I've decided to learn Java and give it a try. I have a short and amateur experience with python, therefore I'm not a kind of programming expert. After many days trying to figure out how to set up Sublime Text to run and compile Java, I've decided to come for any help.
I've already installed JDK and I was using Netbeans, but I prefer a minimalistic IDE.
I created a .sublime-build file like this below..
However when I try to build the code, it returns me that error below..
So, probably I've done something wrong, but I can't really figure out what it is. I'm using Ubuntu 14.10 and that's the reason I cannot find many answers out there, so I'd really appreciate if anyone could help me out!
解决方案
Tested on Ubuntu 16.04 LTS with Sublime Text3.
Make your own sublime-build system, and enter this code:
{
"shell_cmd": "javac \"$file\" && java \"$file_base_name\"",
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
}
This will let you first compile the file AND run the class based on the file name together. After this, you will see the result of string "Hello World"