1

how do you compile in Eclipse? And how do you run the program using this given with the choices: Java Applet or Java Application?

2

2 Answers 2

1

If Project -> Build Automatically is enabled, you will compile when saving your work.

To run it, you have an arrow in a green circle in your toolbar (6th tool if you have a default benchmark). It will run the project using the currently showing class as a main class if it has a main method, or the last run main if it doesn't. Alternatively, you can use the keyboard shortcut CTRL+F11.

If you click on the little down arrow next to the green button, you can access to a history of classes you ran and to the Run configuration, which allows you for example to run a program with parameters or, what interrests you here, to choose to run it as an applet or an application.

Sign up to request clarification or add additional context in comments.

Comments

0

Turn on the option: Project > Build Automatically

If you have a main method, run as Java Application. To create a main, type main then ctrl+space and select "main method" to have eclipse auto create it for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.