Trouble Accessing Java Classes from Python Using GraalPy and GraalVM #448
Answered
by
msimacek
ShuzoShinagawa1102
asked this question in
Q&A
|
Hello everyone, What I want to doI'm trying to access a Java class from a Python script using GraalPy (GraalPython) with GraalVM, but I'm encountering an error that I can't seem to resolve. Python Script (main.py) Java Class(User.java) I've compiled the Java class and packaged it into a JAR file named gpdemo-0.0.1-SNAPSHOT-plain.jar, and I set it as classpath for zshrc. Execution command Error Message: What I've Tried:
Environment Details:GraalVM Version: Oracle GraalVM 23.0.1+11.1 Questions:
|
Answered by
msimacek
Oct 30, 2024
Replies: 2 comments 3 replies
|
additionally, here is the contained classes which are showed by |
0 replies
|
Hi @ShuzoShinagawa1102, the option for supplying classpath when running through the graalpy launcher is |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

I tried your example and it printed
Alicewith no errors. What I did:com/example/model/User.javaand your python code asmain.pyjavac com/example/model/User.javagraalpy --vm.cp=. main.pyThe differences I have from you is that I used the latest release, I'm on Linux and I didn't build a JAR. Could you please try the latest release (24.1.1, the
graalpy-jvmvariant)?