How to run java programs ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to run java programs ?

What's the best way to run a java program that i coded ?

30th May 2019, 5:21 PM
Faiz Tchekiken
Faiz Tchekiken - avatar
3 Answers
+ 5
Hi Faiz Tchekiken , 🍎 their are many ways to compile your Java program like in Netbeans, Eclipse IDE first you need to create an project file by going on create new file -> select Java application -> name your project-> then an field will come up to the screen with default Java class with the name of your project and default code. Then when you have made the program you can save at and press on debug from top menu bar then the program will debugged automatically and if any error occurred then show them towards you Have some 🍎 🍎 🍎 🍎
30th May 2019, 5:47 PM
DishaAhuja
DishaAhuja - avatar
+ 4
you can make your file in notepad and link it towards below step 🍎 you can also use CMD for compile and execute the Java project 🍎 javac is the java compiler used to compile your java source code into a class file. To run your program you must use java. 🍎 Placing $ in front of something is done in a linux shell to expand an environment variable, this assumes that the variable is in fact set correctly and you are using a linux shell. 🍎 The java compiler 'javac' is part of the java development kit and needs to be in your path in order to invoke it from any location without specifying the fully qualified and legal filename e.g. "c:\Program Files\java\jdk_5.8.5\bin\javac.exe". 🍎 If your project contains multiple classes then javac will need to be used on each source file, or use a build system such as ant or maven.
30th May 2019, 5:52 PM
DishaAhuja
DishaAhuja - avatar
0
Thanks for helping me
30th May 2019, 5:54 PM
Faiz Tchekiken
Faiz Tchekiken - avatar