Skip to content

Commit 89f043a

Browse files
committed
Add Java installation bootstrap example to README
1 parent 859a787 commit 89f043a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ u'1.8.0_152-release'
8585

8686
See the [jgo documentation](https://github.com/scijava/jgo) for more about Maven endpoints.
8787

88+
## Bootstrap a Java installation
89+
90+
```python
91+
>>> from scyjava import config, jimport
92+
>>> config.set_java_constraints(fetch=True, vendor='zulu', version='17')
93+
>>> System = jimport('java.lang.System')
94+
cjdk: Installing JDK zulu:17.0.15 to /home/chuckles/.cache/cjdk
95+
Download 100% of 189.4 MiB |##########| Elapsed Time: 0:00:02 Time: 0:00:02
96+
Extract | | # | 714 Elapsed Time: 0:00:01
97+
cjdk: Installing Maven to /home/chuckles/.cache/cjdk
98+
Download 100% of 8.7 MiB |##########| Elapsed Time: 0:00:00 Time: 0:00:00
99+
Extract | |# | 102 Elapsed Time: 0:00:00
100+
>>> System.getProperty('java.vendor')
101+
'Azul Systems, Inc.'
102+
>>> System.getProperty('java.version')
103+
'17.0.15'
104+
```
105+
88106
## Convert between Python and Java data structures
89107

90108
### Convert Java collections to Python

0 commit comments

Comments
 (0)