Open tapz opened 4 years ago
Can you provide more details? like your project setup? maybe share your project?
I can't share my project. It's a React Native project. Just a normal Java project, which compiles just fine.
So I'm assuming it's an Android project then? If so, then sorry but it's not supported by vscode-java
Yes. Android. What makes Android so different? It's my Java class after all, not any Android class.
Android uses special Gradle plugins to compute the project classpath, that are not supported in Buildship, the underlying Gradle Integration plugin we delegate Gradle support to.
@fbricon How do you solve this problem?
@fbricon How do you solve this problem?
Android development is not supported at the moment. It will require a significant amount of work at Buildship as mentioned by @fbricon
Currently, there is no ideal solution for that but you can try the Lightweight mode by settingjava.server.launchMode
to LightWeight
. You will be able to use a subset of features like Go to Definition of the types inside your local source and JDK. But there are also limitations, you won't be able to navigate to the types in Android SDK, and you won't be able to build and debug.
Add working files to the project's source path
I have the same problem when using 'package package_name' , my solution is that clost it and open it again....
I have the same problem:
btw, i can clean .classpath file (e.g. git clean -dfx
) and reopen the folder with vscode to solve it.
I had the same problem here, but I guess that I managed to solve this, just moving the '.vscode' folder into the project folder. Into that have a JSON file pointing to the project path. When I oppened that I've tried to change the path, but had no success. When I moved the entire folder, and after restart VS Code, the error disapeer. Then, I ran a HelloWorld.java test, and it worked for me.
In VS Code just right-click on the src (the folder which contains all java files) folder and select the " Add folder to Java source path" option. If it didn't' worked, then try to remove it first by selecting "remove the folder from Java source path" and then adding it again.
Restart once when done. Hope it works for you.
In VS Code just right-click on the src (the folder which contains all java files) folder and select the " Add folder to Java source path" option. If it didn't' worked, then try to remove it first by selecting "remove the folder from Java source path" and then adding it again.
Restart once when done. Hope it works for you.
Can't add to source path: Unsupported operation. Please use build.gradle file to manage the source directories of gradle project.
Still it shows
unsupported operation. please use build.gradle
Java files always give me this error in vscode:
Environment
Steps To Reproduce
Current Result
Error
Expected Result
No error
Additional Informations