Tim Matthews
Tim Matthews

Reputation: 5121

How can I extract java exe to jar

I have an exe that I know was written in java. I understand that java programs can be made into an exe and there are tools to convert jar files to exe but is it possible to convert back? AFAIK jar files can be run on any platform that can run java and I would like to use a windows compiled java program on mac without using any extra virtualisation (wine,vmware)

Upvotes: 10

Views: 65946

Answers (4)

VonC
VonC

Reputation: 1323653

It depends how the exe has been built:

  • If it has simply wrapped, with a tool like JSmooth, the same tool can extract the jar
  • If it it has been compiled, with for instance gcj (as illustrated by this question),... I am not sure.
  • If it has been compiled by a static compiler (or AOT - Ahead-Of-Time -), I believe it is not possible to extract the orignial jars.

Upvotes: 15

kh2tech
kh2tech

Reputation: 21

i suggest just rename your file extension from .exe to .jar and try to extract them. to view the code use java Decompiler LIKE: http://java-decompiler.github.io

Upvotes: 2

It is possible to convert file.exe back to file.jar , To go with this reversing process to will require you to know how the file was beeen encrypted ,for example if is the first level encryption class name and files are not hidden , for the second level file classes are hidden , for the 3rd level file and classes are hidden . to get this well download jar to exe software and try how they convert jar to exe then you will be able to know the reverse. to know how you proceed with reversing the process there is a single blog which helped me and all tools you may use are listed there like : Resource Hacker Winhex Ollydbg 1.10+ MemoryDump 0.9 and Olly Advanced or StrongOD Plugin(for advanced ctrl+g). DJ Java Decompiler 7-Zip or Winrar The link: https://reverseengineeringtips.blogspot.com/2014/12/unpacking-jar2exe-21-extracting-jar.html?showComment=1480364662658#c447064983483780468

thanks

Upvotes: 0

James Van Huis
James Van Huis

Reputation: 5561

If your application was wrapped using JSmooth, you can look in your default temp directory (C:\Documents and Settings\Username\Local Settings\Temp) while the application is running.

Open a windows explorer window to the temp dir, then start up your application. You should see a jar file show up (Temp#.jar). Just make a copy of this and you should be on your way.

Upvotes: 5

Related Questions