Comments (8)
FWIW, I noticed that when I Java: Configure Java Runtime
, the type of project app is "Unmanaged folder", and not "Gradle" as I would have expected, but I don't know how to change that. Not sure if that's related.
from vscode-java.
Poking around /Users/kal/.gradle/caches/modules-2/files-2.1, I noticed something peculiar about org.graalvm.polyglot/python-community: it only includes a pom file, and no jars, unlike other dependencies.
I noticed that in the Maven setup for embedded GraalPy (see also here), <type>pom</type>
is specified, i.e. the python-community is a "pom-type" dependency.
Searching for [jdt "pom dependency"] on Google reveals [jira] [Closed] (MCOMPILER-544) ZipException: zip END header not found on POM dependency with Eclipse compiler:
ZipException: zip END header not found on POM dependency with Eclipse compiler
There is an impedance matching issue between Maven Compiler Plugin, plexus-compiler-eclipse, and eclipse.jdt.core. m-c-p adds POM dependency's POM file to classpath, which makes it through plexus-compiler-eclipse to JDT and that prints an exception ZipException: zip END header not found. Arguably, m-c-p should not be adding non-JAR, non-wildcard-directory path to classpath for the compiler.
The issue seems to have been tracked in apache/maven-compiler-plugin#198 and codehaus-plexus/plexus-compiler#302.
from vscode-java.
It looks like the issue was reported to the Eclipse JDT project (eclipse-jdt/eclipse.jdt.core#1274) but they closed the issue without a fix, and the fix was made in the Maven Compiler Plugin (see link in previous comment). IIUC, that would mean that a fix similar to apache/maven-compiler-plugin#198 would be needed in vscode-java.
As mitigation, I wonder if there is a way to get vscode-java to ignore certain dependencies, like the pom-type python-community dependency.
from vscode-java.
There is another Eclipse JDT issue related to the Zip problem that is still open: eclipse-jdt/eclipse.jdt.core#1578
from vscode-java.
Ok I have found a partial mitigation but it is not complete. I changed
implementation("org.graalvm.polyglot:python:23.1.2")
in build.gradle.kts
to
implementation("org.graalvm.polyglot:python:23.1.2") {
exclude(group = "org.graalvm.polyglot", module = "python-community")
}
Running ./gradlew run
still works (it prints "Hello Python!") but there are now some scary looking errors that indicate possible trouble with anything more complicated than a Hello World program:
[python::PythonContext] WARNING: could not determine Graal.Python's core path - you may need to pass --python.CoreHome.
[python::PythonContext] WARNING: could not determine Graal.Python's sys prefix path - you may need to pass --python.SysPrefix.
[python::PythonContext] WARNING: could not determine Graal.Python's standard library path. You need to pass --python.StdLibHome if you want to use the standard library.
[python::PythonContext] WARNING: could not determine Graal.Python's C API library path. You need to pass --python.CAPI if you want to use the C extension modules.
[python::PythonContext] WARNING: could not determine Graal.Python's C API library path. You need to pass --python.CAPI if you want to use the C extension modules.
[python::PythonContext] WARNING: could not determine Graal.Python's JNI library. You need to pass --python.JNILibrary if you want to run, for example, binary HPy extension modules.
[python::PythonContext] WARNING: could not determine Graal.Python's C API library path. You need to pass --python.CAPI if you want to use the C extension modules.
[python::PythonContext] WARNING: could not determine Graal.Python's C API library path. You need to pass --python.CAPI if you want to use the C extension modules.
[python::PythonContext] WARNING: could not determine Graal.Python's JNI library. You need to pass --python.JNILibrary if you want to run, for example, binary HPy extension modules.
from vscode-java.
Adding /Users/kal/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/python-community/23.1.2/2534a71914ae30007251d1f91f67bb5b5b3431d/python-community-23.1.2.pom to java.project.referencedLibraries.exclude
has no effect.
from vscode-java.
Ok here might be a better mitigation. It seems like the pom dependencies are just placeholders to pull in other, real dependencies. So I inspected the dependencies of
- /Users/kal/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/python/23.1.2/85f926b2f5d99d5753d2ec925a1051b94ed0dff5/python-23.1.2.pom
- /Users/kal/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/python-community/23.1.2/2534a71914ae30007251d1f91f67bb5b5b3431d/python-community-23.1.2.pom
and determined which ones looked like they were necessary. In build.gradle.kts I replaced
implementation("org.graalvm.polyglot:python:23.1.2")
with
implementation("org.graalvm.python:python-language:23.1.2")
implementation("org.graalvm.python:python-resources:23.1.2")
implementation("org.graalvm.truffle:truffle-runtime:23.1.2")
and the entries in the Problems pane that I reported appear to have gone away, and there is no discernible difference in the output of ./gradlew run
.
It would still be great if the underlying problem of adding these pom-only dependencies to the class path (IIUC) could be fixed.
from vscode-java.
Interestingly, vscode-java does not appear to suffer from this issue when using the example GraalPy Maven project (which can be set up with a single command), indicating the issue may be related to Gradle or how vscode-java is using Gradle.
from vscode-java.
Related Issues (20)
- JavaSE-22 Runtime is not compatible HOT 1
- quick for add method to interface? HOT 1
- Couldn't Start Client Java Language Server HOT 7
- lombok @Singular cause Lombok annotation handler class lombok.eclipse.handlers.HandleBuilder failure HOT 5
- `java.util.List.*` in "java.completion.favoriteStaticMembers" has no effect on completion HOT 2
- Autoimport on accepting a suggestion moves cursor when "quickSuggestions" is set to "inline"
- Option to switch build tool after initial import of mixed gradle/maven project HOT 5
- Java string paste not auto escape HOT 2
- Extension makes a '~' folder on Windows. HOT 9
- not suppor a package name with dot HOT 3
- Semantic highlighting for lambdas HOT 5
- Formatting code using Java string literals fails. HOT 3
- Language Server fails to start with multiple --add-exports in java.jdt.ls.vmargs HOT 4
- Editor Error Highlighting And Fix Suggestions Not works on v1.29.0 HOT 8
- Changing property file didn't triggered the compilation HOT 6
- "The source path must be contained in the project root folder" HOT 4
- Multiple Java projects - How? HOT 2
- Improve suggestion on annotation fields HOT 3
- cant find test resource root HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-java.