@@ -34,7 +34,7 @@ function javahome_winreg()
3434 end
3535end
3636
37- @static isunix () ? (global const libname = " libjvm" ) : (global const libname = " jvm" )
37+ @static Sys . isunix () ? (global const libname = " libjvm" ) : (global const libname = " jvm" )
3838
3939function findjvm ()
4040 javahomes = Any[]
@@ -43,12 +43,12 @@ function findjvm()
4343 if haskey (ENV ," JAVA_HOME" )
4444 push! (javahomes,ENV [" JAVA_HOME" ])
4545 else
46- @static iswindows () ? ENV [" JAVA_HOME" ] = javahome_winreg () : nothing
47- @static iswindows () ? push! (javahomes, ENV [" JAVA_HOME" ]) : nothing
46+ @static Sys . iswindows () ? ENV [" JAVA_HOME" ] = javahome_winreg () : nothing
47+ @static Sys . iswindows () ? push! (javahomes, ENV [" JAVA_HOME" ]) : nothing
4848 end
4949
5050 if isfile (" /usr/libexec/java_home" )
51- push! (javahomes,chomp (readstring (` /usr/libexec/java_home` )))
51+ push! (javahomes,chomp (read (` /usr/libexec/java_home` , String )))
5252 end
5353
5454 if isdir (" /usr/lib/jvm/default-java/" )
@@ -57,12 +57,12 @@ function findjvm()
5757
5858 push! (libpaths, pwd ())
5959 for n in javahomes
60- @static if iswindows ()
60+ @static if Sys . iswindows ()
6161 push! (libpaths, joinpath (n, " bin" , " server" ))
6262 push! (libpaths, joinpath (n, " jre" , " bin" , " server" ))
6363 push! (libpaths, joinpath (n, " bin" , " client" ))
6464 end
65- @static if islinux ()
65+ @static if Sys . islinux ()
6666 if Sys. WORD_SIZE== 64
6767 push! (libpaths, joinpath (n, " jre" , " lib" , " amd64" , " server" ))
6868 push! (libpaths, joinpath (n, " lib" , " amd64" , " server" ))
@@ -76,16 +76,16 @@ function findjvm()
7676 push! (libpaths, joinpath (n, " lib" , " server" ))
7777 end
7878
79- ext = @static iswindows () ? " dll" : (@static isapple () ? " dylib" : " so" )
79+ ext = @static Sys . iswindows () ? " dll" : (@static Sys . isapple () ? " dylib" : " so" )
8080 ext = " ." * ext
8181
8282 try
8383 for n in libpaths
8484 libpath = joinpath (n,libname* ext);
8585 if isfile (libpath)
86- if iswindows ()
86+ if Sys . iswindows ()
8787 bindir = dirname (dirname (libpath))
88- m = filter (x -> ismatch (r" msvcr(?:.*).dll" ,x), readdir (bindir))
88+ m = filter (x -> occursin (r" msvcr(?:.*).dll" ,x), readdir (bindir))
8989 Libdl. dlopen (joinpath (bindir,m[1 ]))
9090 end
9191 global libjvm = Libdl. dlopen (libpath)
@@ -124,14 +124,14 @@ struct JavaVMInitArgs
124124end
125125
126126
127- @static isunix () ? (const sep = " :" ) : nothing
128- @static iswindows () ? (const sep = " ;" ) : nothing
127+ @static Sys . isunix () ? (const sep = " :" ) : nothing
128+ @static Sys . iswindows () ? (const sep = " ;" ) : nothing
129129cp = OrderedSet {String} ()
130130opts = OrderedSet {String} ()
131131
132132function addClassPath (s:: String )
133133 if isloaded ()
134- warn (" JVM already initialised. This call has no effect" )
134+ @ warn (" JVM already initialised. This call has no effect" )
135135 return
136136 end
137137 if s== " " ; return ; end
0 commit comments