Skip to content

Commit 6e02219

Browse files
authored
add more warnings (#104)
* add more warnings * move warning to module load.
1 parent 3f8d041 commit 6e02219

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/JavaCall.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ include("convert.jl")
2929
include("reflect.jl")
3030

3131
function __init__()
32+
if VERSION v"1.1-" && VERSION < v"1.3-"
33+
@warn("JavaCall does not work correctly on Julia v$VERSION. \n " *
34+
"Either use Julia v1.0.x, or v1.3.0 or higher.\n"*
35+
"For 1.3 onwards, please also set the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`")
36+
end
37+
if VERSION v"1.3-" && get(ENV, "JULIA_COPY_STACKS", "") ("1", "yes")
38+
@warn("JavaCall needs the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`. "*
39+
"Calling the JVM may result in undefined behavior.")
40+
end
3241
findjvm()
3342
global create = Libdl.dlsym(libjvm, :JNI_CreateJavaVM)
3443
end

src/jvm.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ end
152152
addOpts(s::String) = isloaded() ? @warn("JVM already initialised. This call has no effect") : push!(opts, s)
153153

154154
function init()
155-
if VERSION v"1.3" && get(ENV, "JULIA_COPY_STACKS", "") ("1", "yes")
156-
@warn("JavaCall needs the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`. "*
157-
"Calling the JVM may result in undefined behavior.")
158-
end
159155
if isempty(cp)
160156
init(opts)
161157
else

0 commit comments

Comments
 (0)