As you know .jar file is combination of one or many class files. So if any of your JAVA file source changed then you need to compile that one NOT the .jar file.
Once you compile the desired java file into .class file then just create the .jar file again.
I have a jar file with a number of .java files in it. I have extracted the .jar file and changed in some files.
I would like to compile all the files in it into class files and save them all with retaining the existing
directory structure in the sources.jar file. Any idea how to do this?
Hitesh Patel Patel
Joined: Jul 23, 2009
One thing you should understand that JAR file cannot be complied rather it can be created.
So if files within your JAR are changed then you need to compile either on command prompt OR use eclipse / netbeans. Then later just overwrite / create new jar to different location with the same name.
I hope this will help you.
Joined: Jun 21, 2012
how can i compile this mutiple java files in different subfolders using eclipse or any other easy way. i want to remain existing folder sturcture.
You create a project in Eclipse, add the .java files to the project and build the project. It will even build the jar file for you.
If you don't know how to do any of those parts then you need to read an Eclipse tutorial and/or their help pages. Nobody here is going to tell you how to do something when detailed instructions are readily available on the internet. You need to ShowSomeEffort. If you then have a specific question about any part of the process, people here will be glad to help.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How how compile source files of .jar File?