Skip to content

Commit c3a9f40

Browse files
committed
Add Java bootstrapping example to documentation
1 parent 8aa8875 commit c3a9f40

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/scyjava/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@
4040
+++oo*OO######O**oo+++++oo*OO######O**oo+++++oo*OO######O**oo+++
4141
+++oo*OO######OO*oo+++++oo*OO######OO*oo+++++oo*OO######OO*oo+++
4242
43+
Bootstrap a Java installation:
44+
45+
>>> from scyjava import config, jimport
46+
>>> config.set_java_constraints(fetch=True, vendor='zulu', version='17')
47+
>>> System = jimport('java.lang.System')
48+
cjdk: Installing JDK zulu:17.0.15 to /home/chuckles/.cache/cjdk
49+
Download 100% of 189.4 MiB |##########| Elapsed Time: 0:00:02 Time: 0:00:02
50+
Extract | | # | 714 Elapsed Time: 0:00:01
51+
cjdk: Installing Maven to /home/chuckles/.cache/cjdk
52+
Download 100% of 8.7 MiB |##########| Elapsed Time: 0:00:00 Time: 0:00:00
53+
Extract | |# | 102 Elapsed Time: 0:00:00
54+
>>> System.getProperty('java.vendor')
55+
'Azul Systems, Inc.'
56+
>>> System.getProperty('java.version')
57+
'17.0.15'
58+
4359
Convert Java collections to Python:
4460
4561
>>> from scyjava import jimport

0 commit comments

Comments
 (0)