Latest News

Showing posts with label cmd. Show all posts
Showing posts with label cmd. Show all posts

Tuesday, August 29, 2017

August 29, 2017

How to run java program from command prompt ?


1. Write the following code into NOTEPAD.

public class HelloWorld {

    public static void main(String[] args) {
                System.out.println("Hello, World");
    }
}

2. Now save this file as Hello.java.
3. Open command prompt as an admin and locate directory wherever you save this file.
4. First thing you need to compile java  class to write javac hello.
5. Then after if no error appears then write java hello , output will print.

if you haven,t installed java yet then follow this.
August 29, 2017

How to set up java in windows 10 ?

So first thing you need to perform is install jdk from here

1. Choose jdk as per your system if your system has 32 bit then download 32 bit else download 64 bit.

JDK 86(32-bit)
2. Open system propeties by pressing window key + pause(break) or by following.
System property
3. Now go to the advanced system setting on the letf panel.

4. Now select environment varibales.



5. Go to the system variable and create new and follow below details.


NOTE: Choose whatever path of jdk as in your system. Create same variable in User variable also.

Type java in cmd and if you get output like this than you have successfully set up java in your machine.

🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵🍵