How to specify the main() class in "jar -cfe ..." ?

R

Raymond Schanks

Assume I want to create a jar archive with a command

jar -cfe myjar.jar <MainApp> *.class

for some classes. The entrypoint should be the main() method in class "MyTestclass123".

What do I have to specify for <MainApp> in the command above?

Do I have to write:

jar -cfe myjar.jar main *.class

or

jar -cfe myjar.jar MyTestclass123 *.class

What if the main() class is the only main() method in all classes. Can I omit it then and write simply

jar -cf myjar.jar *.class

?

Raymond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top