banner



How To Code In Java On Windows

How to run a Coffee program in Windows x

To run a coffee program in Windows 10, we need first to install Java and so gear up the environment variables. To do this, follow the following steps-

How to install Java?

Footstep 1) Visit the oracle website and then click on download.

How to run a Java program in Windows 10

Step ii) At present, on the next folio, click on Accept License Understanding and download the .exe file of JDK for windows.

How to run a Java program in Windows 10

Stride 3) After downloading the file, start the installation procedure by clicking on the file.

Step 4) Go on clicking on next and don't alter whatever default setting.

Subsequently installation, nosotros demand to set the environment variables.


How to gear up environment variables?

  • Open up the control panel -> System and Security -> Organization -> Advanced System Settings. The following dialog box will appear.
How to run a Java program in Windows 10
  • Click on Environment Variables, go to system variables, and double click on Path.
How to run a Java program in Windows 10
  • At present add together the path of the bin file present in the JRE folder and the JDK binder to the Path variable. The JRE and JDK are by default, present in the Java folder of Program Files.
How to run a Java program in Windows 10

The setup of the Java environment is complete.


How to run a Coffee program in Windows 10

To empathize how to run a Java programme in Windows 10, we will see a uncomplicated case of a Howdy World program-

Stride 1) Open a text editor and write the java lawmaking for the plan. The programme for Hi World is given below-

Step ii) Relieve this file with the .java extension. Brand sure that the name of the file should be the same every bit that of the public class. If the file doesn't have any public grade, we tin can save it with any name, just after compilation, a bytecode file volition be generated with the name of the grade containing the principal method.

Step 3) At present, open the command prompt and open the directory in which we take saved our plan by using the following control.


How to run a Java program in Windows 10

In this example, the directory is desktop.

Footstep 4) Now, run the post-obit command to compile the Java program.


How to run a Java program in Windows 10

Step 5) After the code is compiled, it generates a bytecode file in the same folder having the .java file with a .course extension. This is the file which is executed by the JRE. To run this file, utilize the following command.


How to run a Java program in Windows 10

The output of the program volition be seen on the command prompt.

This is how nosotros can run a java plan in Windows x.


Source: https://www.javatpoint.com/how-to-run-a-java-program-in-windows-10

Posted by: smithhild1992.blogspot.com

0 Response to "How To Code In Java On Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel