0

I have a .jar file and when I extract/open it and open any of the included classes files .class and it shows unreadable text as shown below. Anyone knows why? and how I can show its contents normally?

enter image description here

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Tak
  • 3,536
  • 11
  • 51
  • 93
  • what kind of file did you try to open? – Stultuske Mar 26 '18 at 11:44
  • 2
    A jar file is not meant to be readable by humans, but readable by machines instead. Is your question that you want to decompile it to get a .java file? – Absent Mar 26 '18 at 11:44
  • @Stultuske I have a .jar file, I extracted it then many files and folders, some files are .class and when I try openeing any of them they look like in the screenshot – Tak Mar 26 '18 at 11:45
  • @Tak so, you opened a .class file and expected it to be readable text? do you know what a .class file is? It's the version of your code, compiled so it is readable for the computer. it should not be a (human) readable text – Stultuske Mar 26 '18 at 11:47
  • @Stultuske oh okay, so is there a way to make it readable? or to read the contents of the .jar file? – Tak Mar 26 '18 at 11:48
  • 3
    Two ways, only one guaranteed to give you the completely correct result: 1. ask the author for the code 2. decompile the .class files and hope for the best – Stultuske Mar 26 '18 at 11:51

1 Answers1

1

If you just want to extract source code from the jar please have a look at this question.

Extract source code from .jar file

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
asciimango
  • 56
  • 7