How to get source code from .class file( class file version is 1.2)

12.1k Views Asked by At

Unresolved compilation problem:

Syntax error, parameterized types are only available if source level is 1.5 or greater

I used JD GUI de-compiler but it is giving above error.

is there any way i can get source code

2

There are 2 best solutions below

5
Magnus On

Try javadecompilers.com, I've successfully decompiled some class files there.

7
Bajal On

Try this at the command line. It will also show the JDK version used to compile the class, in the beginning , like: major version: 52

javap -verbose <class name>