3

So I have an Eclipse project I have been working on for quite sometime now and my program that backs up the project hasnt been doing it for months, and I never bothered to check the back ups (stupid me). Well the project got corrupt and I lost all the files and dont have a back up that is even close to up to date. However I do have the jar file that is fairly recent (it only contains .class files) and I was curious if anyone knew how to convert a jar file with .class files into an eclipse project. Thanks for the help!

3
  • I don't know if you can do it in Eclipse, but IntelliJ has a fairly powerful decompiler. You won't get exactly your original source code, variable names, or comments, but you will get something you can work with. Commented Nov 26, 2019 at 19:51
  • I don't know how to do it in Eclipse, but I recommend you to use Git or SVN from now on, so your code is always safe so this doesn't happen again Commented Nov 26, 2019 at 20:00
  • Possible duplicate of restore project from jar file Extract source code from .jar file Commented Nov 26, 2019 at 20:02

1 Answer 1

2

You can follow the steps given below:

  1. Make sure you have a working decompiler in eclipse. If not, please install https://marketplace.eclipse.org/content/enhanced-class-decompiler into your eclipse.
  2. Create a new Java project in eclipse > Right-click the src folder > Click import > Select Archive from the list to import your JAR
  3. Expand the JAR in eclipse and double click a class file to decompile it.

    enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

and in eclipse ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.