Closed andrewstein closed 1 year ago
NOTE: I have the same issue with java 17
Hi, struct
module is supported, but it is implemented as a C module, so you need to allow native access and IO to be able to import it. Create your context with:
Context.newBuilder("python").allowNativeAccess(true).allowIO(IOAccess.ALL).build()
Thank you @msimacek ,
What you wrote put me on the right path. I did manage to ge it to work eventually.
allowIo()
receives a boolean
argument. When I tried
Context context = Context.newBuilder("python").allowNativeAccess(true).allowIO(true).build();
I got a SystemError: Language 'python' not found.
What did work for me is
Context context = Context.newBuilder("python").allowAllAccess(true).build()
So there is something else that I need beyond allowNativeAccess
and allowIO
Ah, the code I wrote was for GraalVM 23.0. Can you update?
Not immediately.
On my personal machine, I get graal via brew on macOs, where the latest is 22.3.1. I can circumvent this on my machine to try it out, but eventually I will have to update the company wide toolchain (which is actually on 21.3.0 on Linux) as well. So, updating is not trivial, but can be done. It will take a week or two. So, the path of least resistance at the moment is a 21.3.0 solution over a "better" 23.0 solution. I will try out your suggestion, but it will take some time. Thank you very much for the help.
I think in 21.3.0 it also required polyglot access and host array access, but I'm not sure anymore. But using allowAllAccess
is fine as well if you don't need to sandbox the code. I'll close this issue, since we found a solution.
The following java code:
Throws an error:
Please add support for the
pack
builtin....FYI