Alex O'Connor
Alex O'Connor

Reputation: 152

Trouble Making executable .jar file

I am trying to make an executable .jar file. I have been all over the internet trying to figure out how to do this from command prompt.

I have a .class file, a .jar file, a .java file, A Manifest.mf file, and a manifest.txt file.

The most common way I've found online is using -jar -cvfm but I get the following message:

Unrecognized option: -cvfe
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

If someone could please provide step-by-step instruction. Also, I am new to this, so if you use "Package.MainClass", please explain what is means. Everything is in one file, not multiple files.

I am using Java 9.0.1 for jdk and 9.0.4 for jre.

Upvotes: 1

Views: 146

Answers (1)

You are confusing things. java -jar.. is not the same command as jar -cvfe.

You might find https://docs.oracle.com/javase/tutorial/deployment/jar/ useful.

Upvotes: 1

Related Questions