banner



How To Run A Java Script In Windows

How to run a Java program in Windows 10

To run a coffee programme in Windows x, nosotros need showtime to install Java then fix the environment variables. To practice this, follow the following steps-

How to install Java?

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

How to run a Java program in Windows 10

Step 2) Now, on the adjacent page, click on Accept License Agreement and download the .exe file of JDK for windows.

How to run a Java program in Windows 10

Step 3) After downloading the file, showtime the installation procedure by clicking on the file.

Pace 4) Continue clicking on adjacent and don't alter any default setting.

Afterward installation, we need to set the surroundings variables.


How to set up surround variables?

  • Open the control panel -> System and Security -> Arrangement -> Advanced Arrangement Settings. The post-obit dialog box volition 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
  • Now add the path of the bin file present in the JRE folder and the JDK folder 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 Java program in Windows 10

To sympathize how to run a Java program in Windows 10, we volition see a unproblematic case of a Hello Earth programme-

Step 1) Open up a text editor and write the java code for the plan. The program for Howdy World is given beneath-

Step 2) Save this file with the .java extension. Make sure that the name of the file should be the same as that of the public course. If the file doesn't have whatever public form, nosotros can save it with whatever name, merely later on compilation, a bytecode file will be generated with the name of the class containing the principal method.

Step 3) Now, open up the command prompt and open up the directory in which we have saved our programme past using the post-obit command.


How to run a Java program in Windows 10

In this case, the directory is desktop.

Footstep 4) Now, run the following command to compile the Java program.


How to run a Java program in Windows 10

Footstep five) After the code is compiled, it generates a bytecode file in the same folder having the .java file with a .class extension. This is the file which is executed past the JRE. To run this file, use the post-obit command.


How to run a Java program in Windows 10

The output of the program will exist seen on the command prompt.

This is how nosotros can run a coffee programme in Windows 10.


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

Posted by: oharewhouse.blogspot.com

0 Response to "How To Run A Java Script In Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel