I have created a batch file containing Java file locations :

"% C:/location..."

Now , when I double click this file, it opens up eclipse with this java class inside.

What I want is that this file also should get executed by clicking the batch file, and after that, the rest of the classes in this package should get executed.

How can I do this?

  • why are you opening "eclipse "? without opening also you can execute your test cases. Jun 14, 2016 at 5:43

1 Answer 1


If I understand your question correctly you try to run the java file and not the compiled code. Try exporting your project as an executable .jar via eclipse and run this via "java -jar FileName.jar". Regarding the second part of your question though, I´ve got no idea what you were trying to say.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.