Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create a java jar file with source code (.java files)?

I'm trying to submit my java homework,and would like to create a jar file that contains the compiled .class files as well as my original source code .java files. I'm using IntelliJ, but didn't find an option of exporting .java to jar. Is there a way to do it by commandlines?

like image 681
TonyGW Avatar asked Oct 29 '13 05:10

TonyGW


Video Answer


1 Answers

try

jar cf jar-file input-file(s)

check http://docs.oracle.com/javase/tutorial/deployment/jar/build.html for more info

like image 70
upog Avatar answered Oct 21 '22 10:10

upog