File tree Expand file tree Collapse file tree
py5-resources/py5-module/src/py5_tools/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
4249def 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 (
You can’t perform that action at this time.
0 commit comments