Skip to content

Commit 37afd17

Browse files
committed
vendor option
1 parent 8e3a2cb commit 37afd17

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

py5-resources/py5-module/src/py5_tools/tools/install_jdk.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
default=False,
3838
help="Install Java Runtime Environment (JRE) instead of Java Development Kit (JDK)",
3939
)
40+
parser.add_argument(
41+
"--vendor",
42+
action="store",
43+
dest="vendor",
44+
default="Adoptium",
45+
help="Java Vendor (bust be one of Corretto, Azul, or the default option Adoptium)",
46+
)
4047

4148

4249
def main():
@@ -53,6 +60,8 @@ def main():
5360

5461
java_version = args.java_version
5562
jre = args.jre
63+
vendor = args.vendor.title()
64+
5665
installing = "Java Runtime Environment" if jre else "Java Development Kit"
5766

5867
if java_version < 17:
@@ -61,10 +70,16 @@ def main():
6170
)
6271
return
6372

73+
if vendor not in {"Corretto", "Azul", "Adoptium"}:
74+
print(
75+
f"Java vendor must be one of Corretto, Azul, or the default option Adoptium",
76+
)
77+
return
78+
6479
try:
6580
print(f"Installing {installing} version {java_version}...")
6681
print(
67-
f"{installing} version {java_version} installed to {jdk.install(java_version, jre=jre)}"
82+
f"{installing} version {java_version} installed to {jdk.install(java_version, jre=jre, vendor=vendor)}"
6883
)
6984
except jdk.JdkError as e:
7085
print(

0 commit comments

Comments
 (0)