Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know the command line used by Eclipse to run the java program?

Tags:

java

eclipse

I have a problem executing my java sample "hello world" program outside Eclipse while Eclipse can execute it whenever I push the Run menu button. So I want to know the command line Eclipse uses to execute the java program.

like image 365
seven_swodniw Avatar asked Feb 28 '12 06:02

seven_swodniw


People also ask

How do I get the command line in Eclipse?

A fully working command-line Terminal inside Eclipse. Just press Ctrl+Alt+T to open a local command prompt (Terminal).

How do I run a Java program from the command line in Eclipse?

In Eclipse, select File → Export, then Java → Runnable JAR File. Launch Configuration identifies which program should be exported. Find the one that runs the class containing your main() method. Export Destination is the name and location of the JAR file you want to generate.

What command line tool is used to run a Java program?

The javac utility is the most important command-line interface (CLI) tool you will find in the JDK's bin directory. This is the Java compiler, and whether you use Maven, Gradle, the SpringSource IDE or Jenkins CI, it's this JDK tool that's used under the covers when Java source code gets compiled.


1 Answers

You can check the other parameters arguments, classpath, environment variables etc. that eclipse might be using to compile your program, from the Run Configurations window, which appears as a dropdown when you click the drop-down button next to the Run button in eclipse.

To get the full command line, you can open the Debug view from Window>Show View>Other.... Right click on the last launch and go to properties. Eclipse will list the exact command line.

like image 53
PCoder Avatar answered Sep 22 '22 18:09

PCoder