Java source file displaying in IntelliJ as an empty decompiled class file
up vote
2
down vote
favorite
I have a project with several .java
files that I can view the source of perfectly in IntelliJ, except for one.
That file is a .java
file like the others, but IntelliJ labels it a "Decompiled .class file" and the source is completely empty. If I open the file in a text editor, I can see the source just fine. Ant builds also work fine with this file.
These are not JDK sources that are missing, where you might expect to see decompiled code. And this is not a compiled .class
file I'm opening, either.
Deleting the file from the project and updating from source control to restore it doesn't seem to help.
Here is what it looks like when I try to open the file in IntelliJ:
What might cause this behavior in IntelliJ and what can I do to fix it?
java intellij-idea
add a comment |
up vote
2
down vote
favorite
I have a project with several .java
files that I can view the source of perfectly in IntelliJ, except for one.
That file is a .java
file like the others, but IntelliJ labels it a "Decompiled .class file" and the source is completely empty. If I open the file in a text editor, I can see the source just fine. Ant builds also work fine with this file.
These are not JDK sources that are missing, where you might expect to see decompiled code. And this is not a compiled .class
file I'm opening, either.
Deleting the file from the project and updating from source control to restore it doesn't seem to help.
Here is what it looks like when I try to open the file in IntelliJ:
What might cause this behavior in IntelliJ and what can I do to fix it?
java intellij-idea
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a project with several .java
files that I can view the source of perfectly in IntelliJ, except for one.
That file is a .java
file like the others, but IntelliJ labels it a "Decompiled .class file" and the source is completely empty. If I open the file in a text editor, I can see the source just fine. Ant builds also work fine with this file.
These are not JDK sources that are missing, where you might expect to see decompiled code. And this is not a compiled .class
file I'm opening, either.
Deleting the file from the project and updating from source control to restore it doesn't seem to help.
Here is what it looks like when I try to open the file in IntelliJ:
What might cause this behavior in IntelliJ and what can I do to fix it?
java intellij-idea
I have a project with several .java
files that I can view the source of perfectly in IntelliJ, except for one.
That file is a .java
file like the others, but IntelliJ labels it a "Decompiled .class file" and the source is completely empty. If I open the file in a text editor, I can see the source just fine. Ant builds also work fine with this file.
These are not JDK sources that are missing, where you might expect to see decompiled code. And this is not a compiled .class
file I'm opening, either.
Deleting the file from the project and updating from source control to restore it doesn't seem to help.
Here is what it looks like when I try to open the file in IntelliJ:
What might cause this behavior in IntelliJ and what can I do to fix it?
java intellij-idea
java intellij-idea
edited Nov 19 at 23:39
Karol Dowbecki
14.7k82746
14.7k82746
asked Nov 19 at 21:11
bmessler
9111
9111
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
If the same class (comparing fully qualified name) is both existing in your project and simultaneously coming from a 3rd party dependency at times IntelliJ will get confused.
This happens also for dependencies if you have the decompiled class open in a editor window and press "Download Sources" action. This results in another editor window opening the just downloaded source code for the same class and IntelliJ navigation going bonkers (Ctrl + Left click
jump and other actions).
The only solution I know of is to restart IntelliJ and hope that it works. You can also try File > Invalidate Caches and Restart
which will force IntelliJ to re-index the world.
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting norFile > Invalidate Caches and Restart
seemed to help.
– bmessler
Nov 19 at 21:38
add a comment |
up vote
0
down vote
accepted
I did end up solving my issue.
Somehow, I inadvertently added that individual file's name to the Java Class File Types
list, and so that file was associated as a decompiled .class files in the same way an actual .class file is.
The fix is going to Settings (Ctrl+Alt+S)
⇒ Editor
⇒ File Types
, scrolling down to Java Class in the list of Recognized File Types
, selecting the file name in the list of Registered Patterns
, and clicking the Remove
button.
I did not figure out how it was automatically added to that list. One guess is that I may have accepted a suggestion pop-up or selected the wrong Intention Action, and so the name of the open or active file was added to the .class type list.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382692%2fjava-source-file-displaying-in-intellij-as-an-empty-decompiled-class-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
If the same class (comparing fully qualified name) is both existing in your project and simultaneously coming from a 3rd party dependency at times IntelliJ will get confused.
This happens also for dependencies if you have the decompiled class open in a editor window and press "Download Sources" action. This results in another editor window opening the just downloaded source code for the same class and IntelliJ navigation going bonkers (Ctrl + Left click
jump and other actions).
The only solution I know of is to restart IntelliJ and hope that it works. You can also try File > Invalidate Caches and Restart
which will force IntelliJ to re-index the world.
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting norFile > Invalidate Caches and Restart
seemed to help.
– bmessler
Nov 19 at 21:38
add a comment |
up vote
2
down vote
If the same class (comparing fully qualified name) is both existing in your project and simultaneously coming from a 3rd party dependency at times IntelliJ will get confused.
This happens also for dependencies if you have the decompiled class open in a editor window and press "Download Sources" action. This results in another editor window opening the just downloaded source code for the same class and IntelliJ navigation going bonkers (Ctrl + Left click
jump and other actions).
The only solution I know of is to restart IntelliJ and hope that it works. You can also try File > Invalidate Caches and Restart
which will force IntelliJ to re-index the world.
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting norFile > Invalidate Caches and Restart
seemed to help.
– bmessler
Nov 19 at 21:38
add a comment |
up vote
2
down vote
up vote
2
down vote
If the same class (comparing fully qualified name) is both existing in your project and simultaneously coming from a 3rd party dependency at times IntelliJ will get confused.
This happens also for dependencies if you have the decompiled class open in a editor window and press "Download Sources" action. This results in another editor window opening the just downloaded source code for the same class and IntelliJ navigation going bonkers (Ctrl + Left click
jump and other actions).
The only solution I know of is to restart IntelliJ and hope that it works. You can also try File > Invalidate Caches and Restart
which will force IntelliJ to re-index the world.
If the same class (comparing fully qualified name) is both existing in your project and simultaneously coming from a 3rd party dependency at times IntelliJ will get confused.
This happens also for dependencies if you have the decompiled class open in a editor window and press "Download Sources" action. This results in another editor window opening the just downloaded source code for the same class and IntelliJ navigation going bonkers (Ctrl + Left click
jump and other actions).
The only solution I know of is to restart IntelliJ and hope that it works. You can also try File > Invalidate Caches and Restart
which will force IntelliJ to re-index the world.
answered Nov 19 at 21:17
Karol Dowbecki
14.7k82746
14.7k82746
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting norFile > Invalidate Caches and Restart
seemed to help.
– bmessler
Nov 19 at 21:38
add a comment |
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting norFile > Invalidate Caches and Restart
seemed to help.
– bmessler
Nov 19 at 21:38
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting nor
File > Invalidate Caches and Restart
seemed to help.– bmessler
Nov 19 at 21:38
It's a pretty unique class name, so there shouldn't be any collision issues there. And no other decompiled classes opened in other windows. Neither restarting nor
File > Invalidate Caches and Restart
seemed to help.– bmessler
Nov 19 at 21:38
add a comment |
up vote
0
down vote
accepted
I did end up solving my issue.
Somehow, I inadvertently added that individual file's name to the Java Class File Types
list, and so that file was associated as a decompiled .class files in the same way an actual .class file is.
The fix is going to Settings (Ctrl+Alt+S)
⇒ Editor
⇒ File Types
, scrolling down to Java Class in the list of Recognized File Types
, selecting the file name in the list of Registered Patterns
, and clicking the Remove
button.
I did not figure out how it was automatically added to that list. One guess is that I may have accepted a suggestion pop-up or selected the wrong Intention Action, and so the name of the open or active file was added to the .class type list.
add a comment |
up vote
0
down vote
accepted
I did end up solving my issue.
Somehow, I inadvertently added that individual file's name to the Java Class File Types
list, and so that file was associated as a decompiled .class files in the same way an actual .class file is.
The fix is going to Settings (Ctrl+Alt+S)
⇒ Editor
⇒ File Types
, scrolling down to Java Class in the list of Recognized File Types
, selecting the file name in the list of Registered Patterns
, and clicking the Remove
button.
I did not figure out how it was automatically added to that list. One guess is that I may have accepted a suggestion pop-up or selected the wrong Intention Action, and so the name of the open or active file was added to the .class type list.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I did end up solving my issue.
Somehow, I inadvertently added that individual file's name to the Java Class File Types
list, and so that file was associated as a decompiled .class files in the same way an actual .class file is.
The fix is going to Settings (Ctrl+Alt+S)
⇒ Editor
⇒ File Types
, scrolling down to Java Class in the list of Recognized File Types
, selecting the file name in the list of Registered Patterns
, and clicking the Remove
button.
I did not figure out how it was automatically added to that list. One guess is that I may have accepted a suggestion pop-up or selected the wrong Intention Action, and so the name of the open or active file was added to the .class type list.
I did end up solving my issue.
Somehow, I inadvertently added that individual file's name to the Java Class File Types
list, and so that file was associated as a decompiled .class files in the same way an actual .class file is.
The fix is going to Settings (Ctrl+Alt+S)
⇒ Editor
⇒ File Types
, scrolling down to Java Class in the list of Recognized File Types
, selecting the file name in the list of Registered Patterns
, and clicking the Remove
button.
I did not figure out how it was automatically added to that list. One guess is that I may have accepted a suggestion pop-up or selected the wrong Intention Action, and so the name of the open or active file was added to the .class type list.
answered Dec 7 at 22:02
bmessler
9111
9111
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382692%2fjava-source-file-displaying-in-intellij-as-an-empty-decompiled-class-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown