简体   繁体   English

从jar文件同步Java源

[英]Synchronize java source from jar file

Accidentally i formatted disk with good java source, so now i have old java source and compiled jar file, can i somehow synchronize thems together? 偶然地,我用良好的Java源代码格式化了磁盘,所以现在我有了旧的Java源代码并编译了jar文件,我可以以某种方式将它们同步吗?

  1. I need get java source from jar file 我需要从jar文件获取Java源代码
  2. How to synchronize with existing project in eclipse 如何在Eclipse中与现有项目同步

If you have packaged sources in your jar, you can extract them with any file extractor (like 7zip ) from the src folder inside the jar file. 如果您的jar中打包了源,则可以使用任何文件提取器(例如7zip )从jar文件中的src文件夹中提取它们。

Otherwise you can use a Java Decompiler, this one has a GUI version too. 否则,您可以使用Java Decompiler, 也具有GUI版本。 The second method will not recover your comments/javadoc comments. 第二种方法将不会恢复您的注释/ javadoc注释。

Another method would be to use a disk recovery software, but that will only work if you didn't "securely erase" the files on your partition, as the files are still in the disk, just not indexed, and the recovery rate of this method is very low. 另一种方法是使用磁盘恢复软件,但这仅在您没有“安全擦除”分区上的文件的情况下才有效,因为这些文件仍在磁盘中,只是没有索引,因此恢复率很高。方法很低。 You can check testdisk and photorec for this. 您可以检查testdiskphotorec这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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