Maxent X11 error using Biomod2 from Ubuntu server

94 views
Skip to first unread message

Dino B.

unread,
Jul 30, 2017, 7:41:27 AM7/30/17
to Maxent
I'm trying running Maxent from Biomod2 in an Ubuntu 14.04 server with RStudio remote access. This is the script:

    > library (biomod2)
    > library (raster)
    > library (rJava)
    > setwd("~/data/Maxent")

    > ExplVar = stack("~/Climatecurrent/Tiff/bio_1",
                "~/Climatecurrent/Tiff/bio_8",
                "~/Climatecurrent/Tiff/bio_9",
                "~/Climatecurrent/Tiff/bio_10",
                "~/Climatecurrent/Tiff/bio_11",
                "~/Climatecurrent/Tiff/bio_12",
                "~/Climatecurrent/Tiff/bio_16",
                "~/Climatecurrent/Tiff/bio_17",
                "~/Climatecurrent/Tiff/bio_18",
                "~/Climatecurrent/Tiff/bio_19")

    > spLIST <- c("map6234",
            "map19358",
            "map42190",
            "map5143",
            "map41788",
            "map41299",
            "map42395",
            "map41695",
            "map16672",
            "map41291",
            "map29684",
            "map41686",
            "map899",
            "map20025",
            "map41661",
            "map23062")


    > for (i in 1:length(spLIST)){
    >   spFILEcal <- read.csv(paste("~/Occurrences 30 min", "/", spLIST[i],     
    > ".csv", sep=""),sep=",",dec=".",header=F) 
  
    >   myRespName = "V3"
  
    >   myResp <- as.numeric(spFILEcal[, myRespName])
  
    >  myRespCoord = spFILEcal[c("V1","V2")]
  
    >   myBiomodDataTrial <- BIOMOD_FormatingData(resp.var = myResp, 
                                            expl.var = ExplVar, 
                                            resp.xy = myRespCoord, 
                                            resp.name = myRespName, 
                                            PA.nb.rep = 3, 
                                            PA.nb.absences = 10000, 
                                            PA.strategy = 'sre', 
                                            PA.sre.quant = 0.025, 
                                            PA.table = NULL, 
                                            na.rm = TRUE)
  
    >   myBiomodOption <-   BIOMOD_ModelingOptions(MAXENT.Phillips = list(visible=F))
  
    >   myBiomodModelOutTrial <- BIOMOD_Modeling (myBiomodDataTrial, models = 'MAXENT.Phillips', 
                                            models.options = myBiomodOption, NbRunEval=3, DataSplit=80, 
                                            Prevalence=0.5, 
                                            VarImport=3, 
                                            models.eval.meth = c('TSS','ROC'), 
                                            SaveObj = TRUE, 
                                            rescal.all.models = TRUE,
                                            do.full.models = FALSE,
                                            modeling.id= paste(spLIST[i],"Trial",sep=""))
}


I keep getting this error:

    > Model=MAXENT.Phillips Creating Maxent Temp Proj Data..  Running
    > Maxent... 
    > Exception in thread "main" java.lang.InternalError: Can't
    > connect to X11 window server using ':0' as the value of the DISPLAY
    > variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native
    > Method) at
    > sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
    > at
    > sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
    > at java.security.AccessController.doPrivileged(Native Method) at
    > sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
    > at java.lang.Class.forName0(Native Method) at
    > java.lang.Class.forName(Class.java:195) at
    > java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
    > at
    > java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
    > at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:120) at
    > java.lang.Class.forName0(Native Method) at
    > java.lang.Class.forName(Class.java:195) at
    > java.awt.Toolkit$2.run(Toolkit.java:869) at
    > java.security.AccessController.doPrivileged(Native Method) at
    > java.awt.Toolkit.getDefaultToolkit(Toolkit.java:861) at
    > sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:1928)
    > at
    > javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:752)
    > at
    > javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:433)
    > at
    > javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
    > at
    > javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1588)
    > at javax.swing.UIManager.setLookAndFeel(UIManager.java:536) at
    > javax.swing.UIManager.setLookAndFeel(UIManager.java:576) at
    > javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1345) at
    > javax.swing.UIManager.initialize(UIManager.java:1455) at
    > javax.swing.UIManager.maybeInitialize(UIManager.java:1422) at
    > javax.swing.UIManager.getUI(UIManager.java:1003) at
    > javax.swing.JPanel.updateUI(JPanel.java:126) at
    > javax.swing.JPanel.<init>(JPanel.java:86) at
    > javax.swing.JPanel.<init>(JPanel.java:109) at
    > javax.swing.JPanel.<init>(JPanel.java:117) at
    > ptolemy.plot.PlotBox.<init>(PlotBox.java:245) at
    > ptolemy.plot.Plot.<init>(Plot.java:214) at
    > ptolemy.plot.MyPlot.<init>(MyPlot.java:22) at
    > density.Runner.initPlots(Runner.java:2366) at
    > density.Runner.writeCumulativeIndex(Runner.java:1832) at
    > density.Runner.start(Runner.java:470) at
    > density.MaxEnt.main(MaxEnt.java:36)

From what I could find on google and other questions (https://stackoverflow.com/questions/10165761/java-cant-connect-to-x11-window-server-using-localhost10-0-as-the-value-of-t), this problem seems to be caused by the remote access on the server, but I'm incapable of understanding why am I getting it on this specific case and how to fix it. 

The point is: how can I stop maxent from calling X11? I can't install it on the server.

Rita Castilho

unread,
May 15, 2018, 7:07:29 PM5/15/18
to Maxent
Hi, Have you solved your problem? I have exactly the same one...
Thanks,
Rita
Reply all
Reply to author
Forward
0 new messages