I'm using Sublime Text 3 for writing and compiling my java programs but the output on Sublime console isn't helpful because we can't give inputs. I had found the sublime build code for C and C++ to show the output on cmd but haven't succeeded in Java. This is what I've written in my java.sublime-build file.
{
"cmd": ["javac", "$file_name"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"variants": [
{
"cmd": ["start", "cmd", "/k", "java", "$file_base_name"],
"shell": true,
"name": "Run"
}
]
}
When I try to run the cmd opens but it isn't able to compile the java file and says, "Could not find or locate the main class". I want to run the program that I've just compiled in a cmd window (not in the Sublime console) What should I add to that command? Thank you.
I myself figured out my query and I am able to run my Java, C/C++, and Python programs and they are all showing the output in a pop-up command prompt and we can even run interactive programs in which programs take inputs.
I wanna share all those sublime-build codes with you all.
JAVA SUBLIME BUILD CODE
C SUBLIME BUILD CODE
C++ SUBLIME BUILD CODE
PYTHON SUBLIME BUILD CODE