Small problem to run any source code in Java

Advertisements

When creating any source code, as in the example below, and after clicking the button to execute, the result of the code execution does not appear, and instead always appears the phrase: "Built Successfully".

Not even clicking on F6 or Shift + F6 works.
Please, how do you go about showing the code result on the screen?

>Solution :

You probably have another class with a main method which is configured to run as the "main class"

Option #1

Make sure the source file is selected in the editor and use Shift+F6 to "Run file"

Option #2

Right click on the project node and select "Properties"

Navigate to "Build" > "Run" and verify the "Main Class" property

Click "Browse" (next to "Main Class") and select the class you want to act as the "Main Class"

Leave a ReplyCancel reply