From 8e4400969766f985cc06361cf55efafd18e4f34a Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Mon, 10 Feb 2020 10:41:17 -0500 Subject: [PATCH 1/2] added warning in case of unset JULIA_COPY_STACKS variable --- Project.toml | 2 +- REQUIRE | 3 --- src/jvm.jl | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 REQUIRE diff --git a/Project.toml b/Project.toml index d501113..a6ad801 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "JavaCall" uuid = "494afd89-becb-516b-aafa-70d2670c0337" -version = "0.7.2" +version = "0.7.3" [deps] DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index da6a941..0000000 --- a/REQUIRE +++ /dev/null @@ -1,3 +0,0 @@ -julia 0.7 -DataStructures -@windows WinReg diff --git a/src/jvm.jl b/src/jvm.jl index 37606e6..9e04f7b 100644 --- a/src/jvm.jl +++ b/src/jvm.jl @@ -152,6 +152,10 @@ end addOpts(s::String) = isloaded() ? @warn("JVM already initialised. This call has no effect") : push!(opts, s) function init() + if get(ENV, "JULIA_COPY_STACKS", "") ∉ ("1", "yes") + @warn("JavaCall needs the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`. "* + "Calling the JVM may result in undefined behavior.") + end if isempty(cp) init(opts) else From df1e9d4674d9b1c20341fa4da99b79b6428f5afa Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Mon, 10 Feb 2020 15:46:19 -0500 Subject: [PATCH 2/2] added version check --- src/jvm.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jvm.jl b/src/jvm.jl index 9e04f7b..4d47a80 100644 --- a/src/jvm.jl +++ b/src/jvm.jl @@ -152,7 +152,7 @@ end addOpts(s::String) = isloaded() ? @warn("JVM already initialised. This call has no effect") : push!(opts, s) function init() - if get(ENV, "JULIA_COPY_STACKS", "") ∉ ("1", "yes") + if VERSION ≥ v"1.3" && get(ENV, "JULIA_COPY_STACKS", "") ∉ ("1", "yes") @warn("JavaCall needs the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`. "* "Calling the JVM may result in undefined behavior.") end