-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java requirements, JAVA_HOME, JRE path setting unclear #32
Comments
After searching stackoverflow, I learned how to set JAVA_HOME in the terminal. I also installed a Java 1.8.x JDK. And how NLRX is running. Despite this, I still get the error:
for every simulation NLRX runs. I suspect this is not ideal. How to set JAVA_HOME in a way that NLRX likes, so that it is persistent? Even more importantly, it would be good to set JAVA_HOME from within NLRX, or do something that has the same effect, telling LNRX where the right JRE is. Here is how I set JAVA_HOME on MacOS, from the terminal: Also, to discover your java version, from the terminal: |
@tmwaring thank you very much for your feedback. We figured out it might be a problem with Rstudio not sourcing the environmental variables correctly. Luckily, we found a way to solve this problem. You just need to set the JAVA_HOME environmental variable from within your Rstudio session, like this: |
Dear @nldoc, Wow, good sleuthing! Because nlrx was working (on three different machines), I was just accepting the error. But your discovery that RStudio is not sourcing the environmental variables correctly explains everything. I've tested your new R code, and can confirm it works just as you said! Thanks so much! |
My pleasure. I am glad the solution works out on your system as well :) |
Happy that nlrx exists! It's not very user friendly or perfectly documented
yet, though. I'm working through various complexities with optimization and
parameter sampling now as well. Looking forward to a full version 1.0! One
thing that would be nice is a computed "# of runs" which nl_run() could
print just before starting the runs. Or even a more verbose set of
reporting such as:
model: model_name
exper: experiment_type
design: sim_design
runs: 525
run? (y/n) or (t) for test run:
…On Tue, Nov 19, 2019 at 9:03 AM nldoc ***@***.***> wrote:
My pleasure. I am glad the solution works out on your system as well :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32?email_source=notifications&email_token=ACUQ2L3Y23TICULA235UKVDQUPWZ7A5CNFSM4JOEYM62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEOJI5Y#issuecomment-555521143>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUQ2LYYE4HDI6XHFB7LO6LQUPWZ7ANCNFSM4JOEYM6Q>
.
|
Thanks again for your very helpful feedback. |
Hi Jan (I assume it's Jan),
Oh, I like your suggestion very much: "summary output, maybe by providing
an nl-object specific output for the basic summary() function." This way a
careful R programmer can just run some test code before starting a large
run.
And yes, I've been all over the webpage. It's very handsome, and complete,
and because it is early still (v0.3.0) this is enough. However, as it
matures the documentation will as well. So adding things like this issue
with RStudio (on the mac only, I guess?) to some troubleshooting page,
might be useful.
Best,
Tim Waring
Associate Professor, School of Economics
Mitchell Center for Sustainability Solutions, University of Maine
web: timwaring.info, phone: 207-581-3157
…On Tue, Nov 19, 2019 at 11:03 AM nldoc ***@***.***> wrote:
Thanks again for your very helpful feedback.
You are right, currently there is not much console output. But in my
opinion it is also challenging to find the right mix of useful console
output vs spamming the console. But I will defenitely think about your
suggestions. I like the idea of having a summary output, maybe by providing
an nl-object specific output for the basic summary() function. Then, one
could do summary(nl) to get a nice formatted overview of the current nl
object. I will check that out soon. I am not sure about interactive console
queries, personally I do not find them really helpful. For doing test runs,
you can also use the run_nl_one() function.
And documentation-wise, I hope you did check out our webpage
<https://ropensci.github.io/nlrx/>?
The link is somewhat hidden at the top of the github repository, so I just
wanted to make sure you are aware of that webpage, which contains a lot
more detailed instructions and examples (check out the "More" menu at the
top).
Best regards
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32?email_source=notifications&email_token=ACUQ2L7J6RXU2AVCPCGGA43QUQE5TA5CNFSM4JOEYM62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEOWWJI#issuecomment-555576101>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUQ2L55EUSHURCDC4SVEJTQUQE5TANCNFSM4JOEYM6Q>
.
|
Dear @nldoc,
Excited to use nlrx. It looks like the best way to connect R and NetLogo yet. I am having trouble getting it to work, and the problem seems to be the java version, or failing to connect to the JRE (java runtime environment). I have:
I use the code:
netlogopath <- file.path("/Applications/NetLogo 6.1.0")
modelpath <- file.path(netlogopath, "/Applications/NetLogo 6.1.0/models/Sample Models/Biology/Wolf Sheep Predation.nlogo")
nl <- nl(nlversion = "6.1.0", nlpath = netlogopath, modelpath = modelpath, jvmmem = 1024)
nl@experiment <- experiment(expname="wolf-sheep", outpath="~/Desktop/", repetition=1, tickmetrics="true", idsetup="setup", idgo="go", idfinal=NA_character_, idrunnum=NA_character_, runtime=50, evalticks=seq(40,50), metrics=c("count sheep", "count wolves", "count patches with [pcolor = green]"), variables = list(), constants = list("initial-number-sheep" = 20, "initial-number-wolves" = 20, "model-version" = "\"sheep-wolves-grass\"", "grass-regrowth-time" = 30, "sheep-gain-from-food" = 4, "wolf-gain-from-food" = 20, "sheep-reproduce" = 4, "wolf-reproduce" = 5, "show-energy?" = "false"))
nl@simdesign <- simdesign_simple(nl=nl, nseeds=3)
results <- run_nl_all(nl)
And I get this error:
JAVA_HOME undefined, using java from path. For control over exact java version, set JAVA_HOME Exception in thread "main" java.lang.UnsupportedClassVersionError: org/nlogo/headless/Main : Unsupported major.minor version 52.0
How do I set JAVA_HOME, as it is not a package variable, apparently? Thanks!
The text was updated successfully, but these errors were encountered: