How To Start Java In Windows 10
How to run a Java program in Windows ten
To run a java program in Windows x, we need offset to install Java and so fix up the environs variables. To practice this, follow the following steps-
How to install Java?
Step 1) Visit the oracle website and and so click on download.
Step 2) Now, on the next page, click on Accept License Agreement and download the .exe file of JDK for windows.
Step 3) Afterwards downloading the file, starting time the installation process by clicking on the file.
Step 4) Keep clicking on side by side and don't alter whatever default setting.
Afterward installation, we need to set the environment variables.
How to set up upwards environment variables?
- Open the control panel -> System and Security -> Organisation -> Advanced System Settings. The post-obit dialog box will announced.
- Click on Environment Variables, go to system variables, and double click on Path.
- At present add the path of the bin file present in the JRE binder and the JDK folder to the Path variable. The JRE and JDK are by default, present in the Java folder of Plan Files.
The setup of the Java environment is complete.
How to run a Coffee program in Windows 10
To understand how to run a Java program in Windows 10, we will see a uncomplicated example of a Hello Earth program-
Step 1) Open a text editor and write the java code for the program. The program for Hullo World is given below-
Step 2) Salvage this file with the .coffee extension. Make sure that the proper noun of the file should exist the same equally that of the public grade. If the file doesn't have any public class, we tin save it with any proper noun, but later compilation, a bytecode file will be generated with the proper name of the grade containing the primary method.
Step 3) Now, open up the command prompt and open the directory in which nosotros have saved our programme by using the post-obit command.
In this case, the directory is desktop.
Footstep 4) Now, run the following command to compile the Java program.
Step 5) Afterward 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 control.
The output of the program will be seen on the command prompt.
This is how we can run a java program in Windows 10.
Source: https://www.javatpoint.com/how-to-run-a-java-program-in-windows-10
Posted by: mcdowellwhoustoll.blogspot.com
0 Response to "How To Start Java In Windows 10"
Post a Comment