java.awt.HeadlessException error running maxent in "dismo" through rJava

114 Views Asked by At

I am trying to run the maxent function in the dismo package on macOS through rJava and keep getting this error message.

Error in rJava::.jcall(mxe, "S", "fit", c("autorun", "-e", afn, "-o", : java.awt.HeadlessException

Has anyone seen it before and know how to fix it? Thank you so much!

1

There are 1 best solutions below

0
Gary Burgmann On

I am working as a dev for EcoCommons (https://app.ecocommons.org.au)

I was having this issue with building out our coding cloud, which is a jupyterhub k8s deployment (https://analysis-tools.app.ecocommons.org.au/coding-cloud). We are using Rstudio Server, but I would imagine the issue is similar perhaps.

RStudio sets the DISPLAY env variable. What you will need to do is unset this high up in your script.

sys.unsetenv('DISPLAY')