thecoderworld
  • Programming
  • Security
  • Tech
  • Open Source
  • How To
  • Lists
  • Windows 11
  • Chromebook
  • Linux
No Result
View All Result
thecoderworld
  • Programming
  • Security
  • Tech
  • Open Source
  • How To
  • Lists
  • Windows 11
  • Chromebook
  • Linux
No Result
View All Result
thecoderworld
No Result
View All Result

Home > Programming > How to Run a Java Program Without IDE?

How to Run a Java Program Without IDE?

Ajoy Kumar by Ajoy Kumar
December 30, 2019
in Programming, Tech
Reading Time: 4 mins read
0
Share on FacebookShare on Twitter

Developers love the robust modern-day Java IDEs, and they make the developer’s life simpler daily. But there are benefits to knowing how to run a Java program without IDE. 

We are going to use Command Prompt to run Java programming. Before this, we have to install and set up Java JDK on your windows 10 computer.

RelatedPosts

How to Create a New Folder in Windows 11

How to Create a New Folder on Windows 11

May 17, 2022
Why Linux Users are Going Crazy over WireGuard

Why Linux Users are Going Crazy over WireGuard?

May 17, 2022

Also Read: How to Install and Setup Java JDK on Windows 10

How to Write Java Code without IDE

To write Java code you can use any source code editor like Notepad++, Sublime Text, Atom, etc. Let us create one simple Java program which will print “Welcome to thecoderworld YouTube Channel!“.

Here we are going to use Notepad++ to create the Java program. Here is the snapshot:

public class HelloYouTube {

     public static void main( String []args ) {

	System.out.println("Welcome to thecoderworld YouTube Channel!");

	}
}

Note:- Your file name and your class name must be same. For example, I create a “HelloYouTube” class, to save this code I have to name my file as HelloYouTube.java and save the file.

So this way you can create your Java program with the help of Notepad++.

Also Read: How to Install Notepad++ on Windows 10

How to Run Java Program in Command Prompt

In this section, we are going to discuss How to Run a Java Program Without IDE. Here are the steps:

Note:- I have saved my Java program at “Desktop” and my Java file name is “HelloYouTube.java”

To check whether the Java and javac is setup or not, you can use these commands in command prompt “java -version” and “javac“. javac is a Java compiler which compiles Java Code.

Also Read: What is Java Compiler (Javac)?

Step 1: Open Command Prompt and change the directory. So, I have saved my Java file at Desktop I will use “cd desktop” command.

change directory of command prompt

Step 2: Now to see all files in the directory, use “dir” command, there you will see your java file.

View all File in the directory

Step 3: To run your Java file you have to create a Java class file of “HelloYouTube.java”. For that use this command “javac HelloYouTube.java”

Step 4: Now to run the Java file using this command “java HelloYouTube”. This command will execute your Java code.

Run Java Program in Command Prompt

Conclusion

An IDE is often proved to be a headache for building and executing simpler programs and applications. In such sort of cases, directly applying javac and java comes pretty handy to build and execute the programs.

Hope this was a helpful article for you. If you have a question in your mind, then leave a comment. We will be thankful to help you!

Previous Post

10 Ways to Protect Your Computer from Hackers

Next Post

7 Best Alternatives to Sony Vegas Pro for Windows

Ajoy Kumar

Ajoy Kumar

I am an entrepreneur by heart and founder of thecoderworld. Who always follows his passion. I love writing about software, coding, open-source, technology, smartphones, tips, and tricks.

Recommended Posts

How to Create a New Folder in Windows 11
How To

How to Create a New Folder on Windows 11

May 17, 2022
Why Linux Users are Going Crazy over WireGuard
Linux

Why Linux Users are Going Crazy over WireGuard?

May 17, 2022
How to Download and Install LibreCAD on Windows 11
How To

How to Download and Install LibreCAD on Windows 11

May 16, 2022
How to Convert a Bootable Pendrive Back to Normal
How To

How to Convert a Bootable Pendrive Back to Normal

May 16, 2022
What is Linux Operating System
Linux

What is Linux Operating System?

May 15, 2022
Reasons Why Linux is Better than Windows
Linux

9 Reasons Why Linux is Better than Windows

May 15, 2022

Leave a Reply Cancel reply

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

Stay Connected

  • 1.3k Fans
  • 702 Followers
  • 56 Followers
  • 24.1k Subscribers

Recent Posts

Why Linux Users are Going Crazy over WireGuard
Linux

Why Linux Users are Going Crazy over WireGuard?

May 17, 2022
How to Create a New Folder in Windows 11
How To

How to Create a New Folder on Windows 11

May 17, 2022
thecoderworld

© 2018 - 2022 thecoderworld

Navigate Site

  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Advertise
  • Career

Follow Us

No Result
View All Result
  • Programming
  • Security
  • Tech
  • Open Source
  • How To
  • Lists
  • Windows 11
  • Chromebook
  • Linux

© 2018 - 2022 thecoderworld