Programming Shortcut - c, c++, java, SQL, online tutorials
No Result
View All Result
  • Home
  • About us
  • Programs in c
  • Programs in cpp
  • Programs in java
  • .Net
  • Privacy Policy
  • Contact Us
  • Home
  • About us
  • Programs in c
  • Programs in cpp
  • Programs in java
  • .Net
  • Privacy Policy
  • Contact Us
No Result
View All Result
Programming Shortcut - c, c++, java, SQL, online tutorials
No Result
View All Result
Home Programming Language

How to set path in java in windows 10, 8.1, 8, 7

admin by admin
April 16, 2020
Reading Time:2min read
0

RELATED POSTS

Armstrong number in c

Program to find out code of grade and percentage calculator in Java

Program to find out the grade and percentage calculator in cpp

If you have decided to learn an object oriented programming language like Java, you might be excited and want to start right away. In this article, I will show you how to make your first simple program and run it on your computer.You need 3 things:

  1. A compiler
  2. A good self-study book or a course
  3. Persistence

There are three editions of Java:

  1. SE: Standard Edition
  2. ME: Mobile Edition
  3. EE: Enterprise Edition

Then you chooes what you want the SE which is Standard Edition. The others are Mobile Edition and Enterprise Edition.

After you have downloaded and installed the JDK,
You need to make one small change in your PC settings. You want the compiler to be accessible from the command prompt.

To do that you have to add the location of the program files to the PATH variable.
1: Click Start → Control Panel → System ( assuming you use Windows 10)
2: Click Advanced → Environment Variables.
3: Find the location of the bin folder in your installation. You can do this by using the Explorer. It’s a good idea to copy the path from there.

It might be: “C:/Programs/Java/jdk1.6.0_23/bin”

4: Add the location to the PATH variable. You probably already have a PATH variable, so choose Edit for that one add a semicolon in the end and the location you copied in step 3
You can test if it is working by opening a command prompt and type JAVAC. This should make the compiler run. Since you did not give a file name as parameter, it just shows you the help file.
Now that you have the compiler working, it is time to make your first Java application. Open notepad or any other simple text editor and type in the following text exactly like shown here.

public class HelloWorld {
        public static void main (String [] args){
                 System.out.println (“Hello World!”);
         }
}
Then save the file as “HelloWorld.java” in the folder where you want to keep your Java projects. Make sure you don’t save it with the.txt extension, even thou it is a text-only file.

Go back to your command prompt and type:
javac HelloWorld.java

This will tell the Java compiler to translate the file you just made. If there is no errors you will now have a file called “HelloWorld.class”. This is the byte code version of your program. It cannot be run as you would do with an executable program file. Instead you need the Java interpreter. You can test your program with the

command:
java Helloworld

Note that you don’t need the.class extension. You should now get the output from your program:

Hello World!

Congratulations! You have now made and tested your first Java program. I recommend you also try to make a small change, to get a feel of how things work. Of course it is difficult now, as most of the code don’t make much sense when you don’t know Java yet. But you can change the text between the quotation marks to make the program print a different text.

ShareTweetPin
admin

admin

Related Posts

Programming Language

Armstrong number in c

November 12, 2022
Program to find out code of grade and percentage calculator in Java
Programming Language

Program to find out code of grade and percentage calculator in Java

April 5, 2022
Program to find out the grade and percentage calculator in cpp
Programming Language

Program to find out the grade and percentage calculator in cpp

March 7, 2022
Program to find out the grade and percentage calculator in c
Programming Language

Program to find out the grade and percentage calculator in c

March 6, 2022
Programs in java

Java program to find quotient and remainder

April 21, 2020
Programs in java

Java program to solve mathematical expressions

April 21, 2020
Next Post

Difference between FOPs and OOPs

Difference and similarities between java and c++

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

Popular Stories

  • Short name by java program

    0 shares
    Share 0 Tweet 0
  • Relation of two numbers in c programming

    0 shares
    Share 0 Tweet 0
  • Bigger and smaller number in c programming

    0 shares
    Share 0 Tweet 0
  • Bigger and smaller number in c++

    0 shares
    Share 0 Tweet 0
  • Java program to perform sum of digits until single digit is obtained

    0 shares
    Share 0 Tweet 0
ADVERTISEMENT
C, C++ & Java Programming tutorial with example Programming Shortcut

Hi Friends, Programming Shortcut is Educational Blog, that From you Learn Programming in Multiple languages like C, C++, Java Programming Language.

LEARN MORE »

Recent Posts

  • Armstrong number in c
  • Program to find out code of grade and percentage calculator in Java
  • Program to find out the grade and percentage calculator in cpp

Categories

  • .Net
  • Programming Language
  • Programs in c
  • Programs in cpp
  • Programs in java
  • Uncategorized

All © 2021 Programming Shortcut - Present By Math Training.

No Result
View All Result
  • Home
  • About us
  • Programs in c
  • Programs in cpp
  • Programs in java
  • .Net
  • Privacy Policy
  • Contact Us

All © 2021 Programming Shortcut - Present By Math Training.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.