@@ -34,7 +34,7 @@ function javahome_winreg()
34
34
end
35
35
end
36
36
37
- @static isunix () ? (global const libname = " libjvm" ) : (global const libname = " jvm" )
37
+ @static Sys . isunix () ? (global const libname = " libjvm" ) : (global const libname = " jvm" )
38
38
39
39
function findjvm ()
40
40
javahomes = Any[]
@@ -43,12 +43,12 @@ function findjvm()
43
43
if haskey (ENV ," JAVA_HOME" )
44
44
push! (javahomes,ENV [" JAVA_HOME" ])
45
45
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
48
48
end
49
49
50
50
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 )))
52
52
end
53
53
54
54
if isdir (" /usr/lib/jvm/default-java/" )
@@ -57,12 +57,12 @@ function findjvm()
57
57
58
58
push! (libpaths, pwd ())
59
59
for n in javahomes
60
- @static if iswindows ()
60
+ @static if Sys . iswindows ()
61
61
push! (libpaths, joinpath (n, " bin" , " server" ))
62
62
push! (libpaths, joinpath (n, " jre" , " bin" , " server" ))
63
63
push! (libpaths, joinpath (n, " bin" , " client" ))
64
64
end
65
- @static if islinux ()
65
+ @static if Sys . islinux ()
66
66
if Sys. WORD_SIZE== 64
67
67
push! (libpaths, joinpath (n, " jre" , " lib" , " amd64" , " server" ))
68
68
push! (libpaths, joinpath (n, " lib" , " amd64" , " server" ))
@@ -76,16 +76,16 @@ function findjvm()
76
76
push! (libpaths, joinpath (n, " lib" , " server" ))
77
77
end
78
78
79
- ext = @static iswindows () ? " dll" : (@static isapple () ? " dylib" : " so" )
79
+ ext = @static Sys . iswindows () ? " dll" : (@static Sys . isapple () ? " dylib" : " so" )
80
80
ext = " ." * ext
81
81
82
82
try
83
83
for n in libpaths
84
84
libpath = joinpath (n,libname* ext);
85
85
if isfile (libpath)
86
- if iswindows ()
86
+ if Sys . iswindows ()
87
87
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))
89
89
Libdl. dlopen (joinpath (bindir,m[1 ]))
90
90
end
91
91
global libjvm = Libdl. dlopen (libpath)
@@ -124,14 +124,14 @@ struct JavaVMInitArgs
124
124
end
125
125
126
126
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
129
129
cp = OrderedSet {String} ()
130
130
opts = OrderedSet {String} ()
131
131
132
132
function addClassPath (s:: String )
133
133
if isloaded ()
134
- warn (" JVM already initialised. This call has no effect" )
134
+ @ warn (" JVM already initialised. This call has no effect" )
135
135
return
136
136
end
137
137
if s== " " ; return ; end
0 commit comments