javarjarmodelmaxent

Cannot open the connexion in Maxent model generation


The output of my code gives this error message and I am not able to fix it. The code itself is long, so I just give you the part that I believe not working, but please ask if you need to see some more.

It seems to me that everything is ok, I have the latest version on Java on my computer. At first, I thought that the error came from C:\Users\Liberty Land\Documents\XXXX\XXXX/maxent.jar because before maxent there is '/' but I tried every combination I could and it still does not work.

Thanks for the help.

Code:

model.runs <- BIOMOD_Modeling(run.data,
                                  models =  models,
                                  NbRunEval = 1,
                                  VarImport = 20,
                                  SaveObj = T,
                                  Yweights = NULL,
                                  rescal.all.models = FALSE,
                                  models.options = BIOMOD_ModelingOptions(
                                    GAM = list(k=3),
                                    MAXENT.Phillips = list(path_to_maxent.jar = "C:/Users/Liberty Land/Documents/XXXX/XXXX")))
    save(model.runs, file = paste0("model.runs", sep = ""))

Output:

Model=MAXENT.Phillips
    Creating Maxent Temp Proj Data..
 Running Maxent...
 Getting predictions...Error in file(file, "rt") : cannot open the connexion
Moreover : Warning messages:
1: In system(command = maxent.cmd, wait = TRUE, intern = TRUE, ignore.stdout = FALSE,  :
  execution of command 'java -mx512m -jar C:\Users\Liberty Land\Documents\XXXX\XXXX/maxent.jar environmentallayers="NAME/models/1616502543/m_15742330/Back_swd.csv" samplesfile="NAME/models/1616502543/m_15742330/Sp_swd.csv" projectionlayers="NAME/models/1616502543/m_15742330/Predictions/Pred_swd.csv" outputdirectory="NAME/models/1616502543/NAME_PA5_Full_MAXENT.Phillips_outputs" outputformat=logistic  redoifexists visible=FALSE linear=TRUE quadratic=TRUE product=TRUE threshold=TRUE hinge=TRUE lq2lqptthreshold=80 l2lqthreshold=10 hingethreshold=15 beta_threshold=-1 beta_categorical=-1 beta_lqp=-1 beta_hinge=-1 betamultiplier=1 defaultprevalence=0.5 autorun nowarnings notooltips noaddsamplestobackground' returns a status of 1

Solution

  • Maxent does not accept space in directory name.