How can I see Java source files after enabling decompiler?

Answered

After enabling decompiler, I can't see original Java source files. It replaces the source file to decompiled file forcibly.

Invalidate cache and reinstalling IDE doesn't help.

How can I fix this? Am I unable to open source file forever?

0
7 comments

Hello,

What do you mean by "enable decompiler"? Do you mean that opening source file from project tree opens decompiled class instead.

 

0
Avatar
Permanently deleted user

When I open Java class library files with Ctrl+Click, decompiled class is opened instead of original source file.

0

I couldn't reproduce the issue on my machine with libraries with downloaded sources. Is it possible to provide sample project example for investigation?

0
Avatar
Permanently deleted user

Here is the sample project:

https://drive.google.com/open?id=1PNGM6bAHJ1y34Cvus9zAJqjB7O64qZFC 

When I clicked 'String' with Ctrl key at first, time, a popup message came out and I pressed enter key by mistake. So I couldn't open source files until now.

0

I couldn't reproduce the issue with your project. It also opens source on my machine. Please try suggestions from this thread: https://stackoverflow.com/questions/49558009/intellij-shows-decompiled-class-file-instead-of-source-code#comment86135147_49558009

0
Avatar
Permanently deleted user

Is this problem related to JDK's type?(Oracle JDK/OpenJDK)

I've changed JDK from OpenJDK 10 to Oracle JDK 8, and now the source file is opened well.

 

0

Do you have Sourcepath configured for your SDK in "Project Structure | SDKs"? If no, then decompiled version will be shown.

0

Please sign in to leave a comment.