answersLogoWhite

0


Best Answer

The command is "java", followed by the class name. For example, if your compiled class is called myclass.class, you give the command:

java myclass

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you run a java program form the command prompt?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the default program to open a jar file to execute a program?

You can open jar files with command prompt, Winrar or java.


Please someone explain you command line argument in C?

Command Line Arguments---- I am trying to explain each word one by oneCommand ------perform specific taskex. When CMD is typed in run window and then press ok button then open a black screen that is called command prompt.Command Line ------on command prompt where command is supplied that is called command line.using command prompt dos commands are executed and java program is also executed using command prompt.for executing java program command is supplied with given syntaxjava java_class_name argument1 argument2.........Java--- is a commandjava_class_name ---name of java file which you want to executeargument1 argument2 --- are the values passing to java application from out sidethese argument1 argument2 are stored in string array argument of main method


What is command to compiler java program?

The command is "javac".


How do you compile source code from the command prompt in java?

compile:javac filename.javarun:java filename


What is the command to compile jre6 program?

It is 'Java program' to be precise, and the command is: 'javac sourcefilename.java'


What is the command to compile a java program named Greetingsjava?

The command to compile a Java program is "javac", followed by the class name (file name).


How do you execute a Java program?

You can run a Java application from the command line using "java <name of the class>"


How do you compile your java code?

save it into a .java file. then open command prompt and navigate to your java bin directory. then type CD then your java bin directory. then type this . javac ProgName.java


What is a command argument?

Command line arguments are provided at the time of running the program. Example: Suppose that your program needs input name and its value then running it from commandline(DOS prompt) you provide the values after the program name java xyz name JAX(name is name and value is jax)


How can i see all the classes and interfaces present in a predefined package in java in command prompt?

use the jar command like this: jar tvf mypackage.jar


How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


What is the name of the command to run a java program?

javausage: java path\FooBar will execute path\FooBar.class