简体   繁体   中英

Finding all java source files needed to re-create a jar

I have a jar file (core.jar) that I need to recreate the jar from java source files using Gradle. I decompiled the jar to identify all of the class files and found the corresponding java files.

Using Gradle, I copied the java files in a directory and tried to compile them. But the compile fails because there are more dependencies that the java files have.

I am trying to figure out how this jar was constructed. If to compile the classes that are in a jar file needs additional java files then was the jar created by compile and project then picking a subset of the class files and packaging them up in a jar?

UPDATE

As per your suggestion, I checked the Manifest file and it only as this:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.4
Created-By: 1.6.0_21-b06 (Sun Microsystems Inc.)

Using JD Decompiler, there are no addition jar files in the jar that I am creating to recreate.

I was able to compile the files by adding the dependent classes as needed. It took some time but was able to compile the classes that I need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM