You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're trying to run your code from a terminal, you need to compile all the classes in the terminal too, using the javac compiler:
❯ javac *.java
That will generate the .class files in the same directory, you can then execute:
❯ java MainApp
Hello, World!
When in vscode, the compilation happens behind the scene, the class files are hidden from you. You need to install the Java Debugger to run your code. Then simply click on the Run or Debug link over the main method: https://youtu.be/o4BTKD3iyYE?t=45
With recent JDKs, calling java MainProgram.java works fine to compile and execute single files in one command. It just doesn't also compile dependent files as well (that I know of)
With recent JDKs, calling java MainProgram.java works fine to compile and execute single files in one command. It just doesn't also compile dependent files as well (that I know of)
true, java App.java works fine. extra question: any hotkey for the java run or debug?
Activity
fbricon commentedon Nov 5, 2020
If you're trying to run your code from a terminal, you need to compile all the classes in the terminal too, using the
javaccompiler:That will generate the .class files in the same directory, you can then execute:
When in vscode, the compilation happens behind the scene, the class files are hidden from you. You need to install the Java Debugger to run your code. Then simply click on the Run or Debug link over the main method: https://youtu.be/o4BTKD3iyYE?t=45
fbricon commentedon Nov 5, 2020
With recent JDKs, calling
java MainProgram.javaworks fine to compile and execute single files in one command. It just doesn't also compile dependent files as well (that I know of)fdq09eca commentedon Nov 5, 2020
true,
java App.javaworks fine. extra question: any hotkey for the java run or debug?testforstephen commentedon Nov 6, 2020
F5-> debugCtrl + F5-> runIt will run the Java file in the current active editor.