Code to put in *.sublime-build
{
"cmd":["javac", "*.java", "&&", "start", "cmd", "/k" ,"java","$file_base_name"],
"selector": "source.java",
"working_dir": "${file_path}",
"shell": true
}
Instructions, in case you couldn't comprehend what I was saying:
1. Locate your sublime text packages folder, at C:\Users\(your name)\AppData\Roaming\Sublime Text 3\Packages\User
2. Create a new file. Name it anything, but afterwards put '.sublime-build'. An example would be MyJavaBuild.sublime-build
3. Open the file using notepad, copy and paste the above code, then save the file.
4. Go to sublime text, navigate to Tools ) Build System ) (your named file)
5. Hit ctrl+b to compile and run
I was annoyed seeing literally no help for compiling using sublime, and even less help for compiling multiple files. So I took it upon myself to make this guide.
This method:
-Opens a console that accepts input
-Is compatible with GUIs
-Opens console even with just a GUI program
-Compiles and runs all java files in your folder at once
-Overwrites all classes in your folder (so you dont have to manually delete .class files each time you want to test a multi-file program)
So, I believe this is the best possible method for compiling and running programs using sublime.
Auf dieser Seite können Sie das Online-Video [Best method] Compile and run multiple java files using Sublime text 3 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer bob bob 29 Oktober 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 498 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!