Tutorial on how to make a Java JAR file with the command prompt

preview_player
Показать описание
A tutorial on how to turn your Java code into a jar file using the command prompt. Command starts at 2:29. Enjoy!
Рекомендации по теме
Комментарии
Автор

very helpful video, even after nearly 10 years... thanks!

syaufmia
Автор

Gah, I spent about an hour trying to find tutorials on how to do this, and this video is the first thing that finally just plainly shows how.  First video I found on YouTube!  Much appreciated!

anorman
Автор

Bro the double enter tip really help .Thanks a lot.

eshailplayer
Автор

Thanks, man, just what I was looking for. I hate that in most courses they don't teach you how to do this, I mean, your IDE is supposed to handle that but I think its important to know what is actually doing the IDE for the jar file to run.

IsJonBP
Автор

This one video answers what stackoverflow could not. Thank you.

SHONNER
Автор

Omg, that was really nice. Quick, simple and I get everything from this vid. Really, I read some tutorials and I get nowhere, till I saw this vid. Thx.

TheNordyk
Автор

With most commands you can select every file with a certain extension by substituting the * symbol for the filename, like *.java,  *.class, or *.txt

Alexvreidy
Автор

Alex, Thank you very much. This video actually helped when Eclipse's Export has been failing!

adrianjohnson
Автор

thankyou very much for sharing this video..this is very helping us when our teacher sucks at teaching

zidanindratama
Автор

Thank you so much. Finally a simple tutorial that works!

P-
Автор

no matter if it's old, the thing that matters, is if it works

thanks

lukasjetu
Автор

I think they're automatically included if you create that JAR correctly. You might have to include a directory with the images in it, but I've never done something like that. There's a relevant question on stackoverflow:

Alexvreidy
Автор

Thank you, I've been looking for a tutorial like this forever :D

ThePigeonBrain
Автор

Yeah, pretty much. I imagine it can be used to declare other things as well, but apparently pointing to your main class is sufficient for creating most JAR files.

Alexvreidy
Автор

Awesome man...short and sweet....tysm for the useful piece of info...

vikramshinde
Автор

You need to set your classpath (the PATH environment variable) to include the JDK's "bin" directory. If you don't want to do that, just type out the entire path instead of javac: in my case, C:\Program MyProgram.java

Alexvreidy
Автор

mine is returning a command like this :

'jar' is not recognised as an internal or external command, operable program or batch file.

what to do next?

aaditshreyas
Автор

Thank you. That was very helpful. I had to create the manifest file, as you suggested. I thought java created the jar file with a manifest file already in it. But I guess not. At least it wouldn't run until I created the manifest.text file, put it in the same directory as the class file, and then ran jar -cfm jarfilename manifest.txt *.class.
Thanks again.

keepaopenmind
Автор

simple yet Gr8 explanation..thanks..

sathyac
Автор

i hv a error that "no main manifest in MyProgram.jar" Can u resolve my error?

shubhamsaurav
welcome to shbcf.ru