Open barreeeiroo opened 6 years ago
Looks like an Android application. FYI vscode-java doesn't support Android project development.
I have the exact same problem. Everything was working 2-3 days ago and right now there's just no code suggestions, no linting etc. I tried updating VSCode, reinstalling the extension multiple times. Nothing fixed it.
Here's a screenshot :
This is not an Android project, I only have .java files
I'm on Windows 7 with JDK 8.
@fbricon it is but it doesn't work with normal Java files @Fudgyking could replicate the issue, so I think it's not releated with the Android project
Actually I just noticed that it still works when I open another folder I worked in before. The only difference between the two I could find were some gradle files that were commited by a collaborator. I'm currently trying to get rid of them and see if it fixes anything.
Try deleting vscode-java's working directory and restart VS Code (Next version will provide a command to do it directly from VS Code)
After removing the gradle files on version control, deleting my local workspace and recloning, it started working again on my side. I couldn't test your option since I already fixed it.
I am still getting this issue even after performing the clean java workspace command in VS Code.
After cleaning the language server workspace, the problem is solved. But why? Are we depending on something outside of our source code to compile project? like classpath/source path settings?
I also seem to have this problem on one of the projects. Cleaning workspace does not fix it.
I can reproduce it every single time. It is a Maven project.
Just initialize this project in an empty folder:
mvn archetype:generate \
-DarchetypeGroupId=org.apache.kafka \
-DarchetypeArtifactId=streams-quickstart-java \
-DarchetypeVersion=2.3.0 \
-DgroupId=streams.examples \
-DartifactId=streams.examples \
-Dversion=0.1 \
-Dpackage=myapps
Open in VSC and it complains about ICompilationUnit VSC: 1.37.1 vscode-java: 0.47.0
I also seem to have this problem on one of the projects. Cleaning workspace does not fix it.
I can reproduce it every single time. It is a Maven project.
Just initialize this project in an empty folder:
mvn archetype:generate \ -DarchetypeGroupId=org.apache.kafka \ -DarchetypeArtifactId=streams-quickstart-java \ -DarchetypeVersion=2.3.0 \ -DgroupId=streams.examples \ -DartifactId=streams.examples \ -Dversion=0.1 \ -Dpackage=myapps
Open in VSC and it complains about ICompilationUnit VSC: 1.37.1 vscode-java: 0.47.0
I have this problem too, same maven project (from kafka streams tutorial).
Make sure to have a org.eclipse.jdt.core.javanature
in your .project file.
I had the same issue with Apache flink -mvn eclipse:eclipse
did the trick. This also generates the .classpath.
I started seeing the same issue recently as well.
Cleaning java language server workspace does not fix for me. However, running mvn eclipse:eclipse
resolves the problem and that does seem to work for me.
But I don't believe that should actually be required and is kind of a pain to figure it out...
I have this problem too, same maven project (from kafka streams tutorial).
You can try the following:
diff --git a/pom.xml b/pom.xml
index e25730f..f62bde4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -114,7 +114,9 @@
</goals>
</pluginExecutionFilter>
<action>
- <ignore/>
+ <configurator>
+ <id>org.eclipse.m2e.jdt.javaConfigurator</id>
+ </configurator>
</action>
</pluginExecution>
</pluginExecutions>
But I don't believe that should actually be required and is kind of a pain to figure it out...
@yxw Could you paste the content of your pom.xml?
I got the same problem with an gradle project. In my .project file it lists org.eclipse.buildship.core.gradleprojectnature as nature. I also tried to remove all project files and restart vscode but it didn't helped. Then I executed clean java langauge server workspace but didn't helped neither.
In the output panel I got the following error:
[Error - 10:16:27] 28.11.2019 10:16:27 Cannot decrypt model file Illegal key size java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039) at javax.crypto.Cipher.implInit(Cipher.java:805) at javax.crypto.Cipher.chooseProvider(Cipher.java:864) at javax.crypto.Cipher.init(Cipher.java:1396) at javax.crypto.Cipher.init(Cipher.java:1327) at com.microsoft.jdtls.intellicode.core.pythia.PythiaModelLoader.decrypt(PythiaModelLoader.java:76) at com.microsoft.jdtls.intellicode.core.pythia.PythiaModelLoader.access$0(PythiaModelLoader.java:70) at com.microsoft.jdtls.intellicode.core.pythia.PythiaModelLoader$1.run(PythiaModelLoader.java:57)
I don't if this is important.
I think that's rather caused by the missing jce for strong authentication.
I think this bug can be closed as this is rather related to project setups - maybe it only needs a doc update or hint?
I fixed my problem by adding GRADLE_HOME to my environment variables pointing to my gradle installation
I got this problem with an Apache Felix OSGI Project.
Edit: I fixed it with an mvn eclipse:eclipse and cleaning java language server workspace, after initialising the project with eclipse (generated .project and .properties files) It would be nice if the java language server could read the project structure from maven alone, so an eclipse configuration isn't needed.
I just discovered when working with a workspace containing multiple maven projects, that for the single maven projects the plugin does not create a .settings
folder containing the "org.eclipse.*" files.
If I open the maven project as a folder in a separate window, then the "org.eclipse.*" files will be created and the issue does not appear + auto-complete works.
Cleaning the workspace as described here solved the issues.
cheers flash :zap:
This also happens to me on a java 8 gradle project. Neither cleaning the workspace nor running the eclipse gradle plugin fixed the issue for me. Also, running with java.import.gradle.home
set to openjdk 19 instead of 8 solves the issue (partially, as the project is not actually buildable with jdk 19, but at least completion and error highlighting works properly)
i also noticed that errors are only highlighted on save, so I guess that they are only found by the filesystem watcher.
its happening to me as well. I am trying to run the flink hello world here: https://flink.apache.org/q/quickstart.sh
vscode + recommended java extension pack, can not open this project and do anything more than notepad w/ it.
After several hrs, finally found the suggestion above. Open a terminal and run
mvn eclipse:eclipse
and vscode suddenly lights up, w/ warnings and errors and everything seemingly as it should be. Nice intro to java/flink for a mostly python/c dev :|
@kouritron You can try to remove
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<versionRange>[3.1,)</versionRange>
<goals>
<goal>testCompile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
from pom.xml
Try deleting vscode-java's working directory and restart VS Code (Next version will provide a command to do it directly from VS Code)
This worked for me.
its happening to me as well. I am trying to run the flink hello world here: https://flink.apache.org/q/quickstart.sh
vscode + recommended java extension pack, can not open this project and do anything more than notepad w/ it.
- [x] Tried installing openjdk-17. play w/ versions. nothing.
- [x] Clear language workspace directory. nope.
- [x] Try 10 diff versions of redhat.java. still nope.
After several hrs, finally found the suggestion above. Open a terminal and run
mvn eclipse:eclipse
and vscode suddenly lights up, w/ warnings and errors and everything seemingly as it should be. Nice intro to java/flink for a mostly python/c dev :|
this works at first but later I realize it is not a perfect solution for the long run. It is the manually generated eclipse project files that get recognized by vscode, not the Maven pom.xml file
@kouritron You can try to remove
<pluginExecution> <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <versionRange>[3.1,)</versionRange> <goals> <goal>testCompile</goal> <goal>compile</goal> </goals> </pluginExecutionFilter> <action> <ignore/> </action> </pluginExecution>
from pom.xml
This worked for me after many hours of debugging. Thank you.
Hello from 2024, this is still a problem if you use the mvn archetype for apache Flink. It will inject this plugin config into your pom.xml. For whatever reason the pluginExecutionFilter mentioned above turns VSCode into Notepad. I lost almost 3 hours on this.
fixed it with the command "Java: Clean Java Language Server Workspace"
its happening to me as well. I am trying to run the flink hello world here: https://flink.apache.org/q/quickstart.sh
vscode + recommended java extension pack, can not open this project and do anything more than notepad w/ it.
* [x] Tried installing openjdk-17. play w/ versions. nothing. * [x] Clear language workspace directory. nope. * [x] Try 10 diff versions of redhat.java. still nope.
After several hrs, finally found the suggestion above. Open a terminal and run
mvn eclipse:eclipse
and vscode suddenly lights up, w/ warnings and errors and everything seemingly as it should be. Nice intro to java/flink for a mostly python/c dev :|
Here in 2024, I am working on a repo that has front end (React) and backend (Java with Maven), and VSCode Java Projects has issues recognizing. I did what this person said to generate the eclipse .classpath file, reloaded the window, and everything works. Thanks @kouritron
RedHat Language for Java is just not working No linter, no code suggestions, no "popups" on hovering, anything
I'm able to get the following error:
[Error - 21:08:10] 08-Oct-2018 21:08:10 file:///home/diego/GitHub/MAKEROID/Makeroid/appinventor/components/src/com/google/appinventor/components/runtime/util/crypt/MakeroidAES256.java does not resolve to a ICompilationUnit
It happens when the extension tries to read any file I already tried deleting the extension and installing it again
Environment
Steps To Reproduce
Current Result
It should be working
Expected Result
It's not working
Additional Informations
It was working time ago, but one day it stopped working, I don't know why