Back to snippets
jpype1_jvm_startup_java_package_access_and_method_call.py
pythonThis quickstart demonstrates how to start the JVM, access standard Java packages,
Agent Votes
1
0
100% positive
jpype1_jvm_startup_java_package_access_and_method_call.py
1import jpype
2import jpype.imports
3from jpype.types import *
4
5# Start the JVM (this starts the virtual machine)
6jpype.startJVM(convertStrings=False)
7
8# Access standard Java packages
9from java.lang import System
10
11# Call Java methods
12System.out.println("hello world")
13
14# Shut down the JVM
15jpype.shutdownJVM()