Created
June 10, 2018 23:37
-
-
Save shelajev/fc3f0b5979c2a3c5990332f632440c2b to your computer and use it in GitHub Desktop.
PolyglotTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PolyglotTest { | |
| public static void main(String[] args) { | |
| System.out.println("Hello World from Java!"); | |
| org.graalvm.polyglot.Context context = | |
| org.graalvm.polyglot.Context.newBuilder().allowAllAccess(true).build(); | |
| context.eval("js", "print('Hello World from JavaScript!');"); | |
| // context.eval("python", "print('Hello World from Python!')"); | |
| // context.eval("R", "print('Hello World from R!')"); | |
| // context.eval("ruby", "puts 'Hello World from Ruby!'"); | |
| context.close(); | |
| try { Thread.sleep(300000); } | |
| catch (InterruptedException e) {} | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment