How do you compile a .class file and make into a jar file?
Ivan
2011-02-10 05:44:54 UTC
I just extracted a jar file and the folder consist of many class files, I already have the edited ones, now how do you compile it and make it into a jar file?
Four answers:
TheBestDarnDaddy
2011-02-10 05:55:21 UTC
Search Executable Jar Maker 1.0
2011-02-10 06:15:02 UTC
javac is the java compiler. jar is the command for creating a jar file from existing class files. However, if you have a lot of java files you need to compile, you will probably want to use a build tool like ant.
Using the jar command typically looks something like jar cvf somefile.jar *
That command will take all the files in the current directory and package them into a jar called somefile.jar. But again, that's a very simple example and real world software application packaging is likely to be more complicated.
Again, you probably want to use something like ant to manage the build and packaging process for you. Just do a google search for "apache ant". There are also tutorials on the ant web site to help you get started writing ant scripts.
?
2016-11-30 10:19:40 UTC
To make a launchable .jar demands you write a ensue report, that's in certainty a text textile report with a course to the class with the main. Then, you're able to use the jdk jar utility with a pair of the concepts flagged interior the command line. it quite is performed, besides the undeniable fact that it takes too a lot time. rather, get the NetBeans IDE to place in writing code and once you're chuffed along with your application, use the shop very final build command and the .jar is in a position to distribute. you will learn quicker and write greater effective code utilising NetBeans.
Vaibhav
2011-02-10 05:47:54 UTC
there is a command
but i recommend to get BlueJ and use file-export-create a jar file
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Search results for 'How do you compile a .class file and make into a jar file?' (Questions and Answers)