diff --git a/graalpy/graalpy-starter/build.gradle.kts b/graalpy/graalpy-starter/build.gradle.kts
index 1199475..842b456 100644
--- a/graalpy/graalpy-starter/build.gradle.kts
+++ b/graalpy/graalpy-starter/build.gradle.kts
@@ -11,7 +11,6 @@ repositories {
dependencies {
implementation("org.graalvm.polyglot:polyglot:24.1.0")
implementation("org.graalvm.polyglot:python:24.1.0")
- implementation("org.graalvm.python:python-embedding:24.1.0")
// Use JUnit Jupiter for testing.
testImplementation("org.junit.jupiter:junit-jupiter:5.11.0")
diff --git a/graalpy/graalpy-starter/pom.xml b/graalpy/graalpy-starter/pom.xml
index 9fa7544..c56da49 100644
--- a/graalpy/graalpy-starter/pom.xml
+++ b/graalpy/graalpy-starter/pom.xml
@@ -41,11 +41,6 @@
${graalpy.version}
pom
-
- org.graalvm.python
- python-embedding
- ${graalpy.version}
-
org.junit.jupiter
@@ -61,27 +56,6 @@
-
-
- org.graalvm.python
- graalpy-maven-plugin
- 24.1.0
-
-
-
-
-
- pyfiglet==1.0.2
-
-
-
- process-graalpy-resources
-
-
-
-
-
-
diff --git a/graalpy/graalpy-starter/src/main/java/com/example/App.java b/graalpy/graalpy-starter/src/main/java/com/example/App.java
index eaa24fa..6b57d53 100644
--- a/graalpy/graalpy-starter/src/main/java/com/example/App.java
+++ b/graalpy/graalpy-starter/src/main/java/com/example/App.java
@@ -7,12 +7,20 @@
package com.example;
import org.graalvm.polyglot.Context;
-import org.graalvm.python.embedding.utils.GraalPyResources;
+import org.graalvm.polyglot.io.IOAccess;
public class App {
public static void main(String[] args) {
- try (Context context = GraalPyResources.createContext()) {
+ try (Context context = Context.newBuilder("python")
+ /* Enabling some of these is needed for various standard library modules */
+ .allowNativeAccess(false)
+ .allowCreateThread(false)
+ .allowIO(IOAccess.newBuilder()
+ .allowHostFileAccess(false)
+ .allowHostSocketAccess(false)
+ .build())
+ .build()) {
context.eval("python", "print('Hello from GraalPy!')");
}
}