0

I have the following package on Eclipse:

com.mortgageapp.projects.app

I'm not interested about the package format at the moment, it's just testing. But I'm wondering how to run the app from the terminal (Windows and Mac)?

It contains a Main.java file where it will begin so I have tried locating and entering the src folder. Then doing something like: javac com/mortgageapp/projects/app/Main.java (or: javac com/mortgageapp/projects/app/*.java).

Just wondering if this is current as when I then do: java com/mortgageapp/projects/app/Main I get a few errors.

asked Apr 1, 2012 at 11:28
0

2 Answers 2

2

Your compilation is probably okay, but to run it you need to specify the class name, not a filename:

java com.mortgageapp.projects.app.Main

That's assuming the current directory is in the classpath. If it's not, you may need:

java -cp . com.mortgageapp.projects.app.Main
answered Apr 1, 2012 at 11:34
Sign up to request clarification or add additional context in comments.

Comments

0

I assume you are writing an RCP application.

Export the project as a RCP application (click the "export" link in your product configuration). You should get a runnable application file.

If you really want to run the application from the terminal, you need to use the main function in the EclipseStarter. But you don't want to go there unless you are doing something very special.

answered Apr 1, 2012 at 11:34

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.