Intellij shows decompiled .class file instead of source code

Answered

Hi there.

I am having issues with Intellij IDEA - it shows me a "decompiled" version of the class instead of its source code if I ctrl+click the class.

I am trying to open regular JDK source files.

 

What I have:

  1. Bytecode Viewer plugin is off.

  2. Java Bytecode Decompiler plugin is off.

  3. Platform, Project and Module all have same JDK version setup.

  4. I have 2 JDK's available in Intellij: jdk1.8.0_161 and jbsdk8u112b287.2_windows_x86 (bundled with Intellij, but comes without src.zip). Tried with both (had to specify src.zip of jdk1.8.0_161 for jbsdk8u112b287.2_windows_x86) - no luck

  5. src.zip is not corrupt - I can open it via WinRAR

  6. When added jdk1.8.0_161 to Intellij, it automatically found src.zip. When manually added src.zip to jbsdk8u112b287.2_windows_x86 Sourcepath tab - it started "Scanning for roots", but warned me that it "cannot determine what kind of files the chosen items contain" and offered me to "attach them as 'Sources'" so I agreed.

  7. Tried File > Invalidate Caches / Restart... - same result.

  8. Same issue in 2017.3 and fresh 2018.1 versions of Intellij.

  9. Providing path for Documentation makes Intellij look for the documentation in the path specified. So it works as it should for both of JDKs. But not for sources.

  10. Everything else works/compiles properly

Any help would be appreciated!

3
4 comments

Известно что-нибудь по этому багу? Та же самая фигня в IU-182.3684.40

-2

I used to have the same problem. The solution for me was to go into File > Project Structures > Modules and mark src as Sources

1

Post is closed for comments.