Re: Maxent Java connection error

2,435 views
Skip to first unread message

musska

unread,
Aug 16, 2013, 5:40:12 PM8/16/13
to max...@googlegroups.com, Matthew Aiello-Lammens
Hi
I'm just staring to use the biomod2 (2.1.15) from R in windows 8, and I found a similar error with maxent. Command Java is executed in R and maxent is recognized as a file in R.
but when computing the models indicates:

Model=MAXENT
Creating Maxent Temp Proj Data..
Running Maxent...
Getting predictions...Error in file(file, "rt") : cannot open the connection

and at the end:
Removing Maxent Temp Data..

if you have an idea to solve it, please let me know

thank you



On Friday, January 18, 2013 7:57:35 AM UTC-3, Damien Georges wrote:
Hi all,

A new version of bimod2 2.0.1 is now available on R-forge (soon on cran). Maybe some of the issue you have will be solve updating the package. If not, please tell me.

Best,

Damien.

Le jeudi 17 janvier 2013 18:59:32 UTC+1, Frieda Beauregard a écrit :
Hi Ben,
I am also just starting to use biomod2, and I have the same errors! Have you got any advice for me?
thanks so much,
Frieda

On Friday, 16 November 2012 13:05:36 UTC-5, Ben Weinstein wrote:
Hi all,

I'm running maxent from R, in the package biomod2. I'm trying to figure out on which side of the equation this java error is coming from.

I have the latest versions of R, maxent, and java, through i've tried going back to java 6/R.15.1/maxent e/ to no avail.

I can start maxent directly without error, no java problems, my path variable is set correctly (java print out below). 

When i call maxent from R, about 70% of the time (mysteriously works 30%), I receive a Java binary error from windows vista, that the binary is not responding and needs to be terminated. I need to manually say stop processes, and then i of course I receive an error from R that the jar file has stopped connecting.


When it fails, which again, is not all of time time, i get in R the error:

Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: running command 'java' had status 1 
2: running command 'java -mx512m -jar C:/Users/Jorge/Desktop/test/maxent.jar environmentallayers="C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Back_swd.csv" samplesfile="C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Sp_swd.csv" projectionlayers="C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_11_1_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_11_2_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_11_3_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_12_1_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_12_2_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_12_3_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_3_1_swd.csv,C:/Users/Jorge/Desktop/test/Adelomyia.melanogenys/MaxentTmpData/Pred/bio_3_2_swd.csv,C:/Users/Jorge/Desktop/test/Adelom [... truncated] 
3: In file(file, "rt") :

If i copy and paste this into the command prompt, it correctly opens and sets the maxent run. 


I would love feedback on what could be the issue!

Thanks for your time,

Ben Weinstein
Stony Brook University


Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Jorge>java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

Maria Hällfors

unread,
Dec 10, 2013, 4:07:55 AM12/10/13
to max...@googlegroups.com, Matthew Aiello-Lammens
Hi everyone,

I seem to have the same problem as I found this thread when looking for a solution on the internet. Has anybody come up with a solution?

Would be grateful for help,
Maria

Maria Hällfors

unread,
Dec 13, 2013, 3:41:47 AM12/13/13
to max...@googlegroups.com, Matthew Aiello-Lammens
Hi again,

I seemed to have solved the problem which turned out to be connected to Java. A helpdesk-person at our university told me that Java easily breaks down if it tries to do an update but is in use in some application at the same time. The solution is to uninstall and reinstall Java. It worked for me, and now MaxEnt is running smoothly in Biomod2 in R.

cheers,

Lasse Ørsted

unread,
Feb 14, 2014, 8:52:32 AM2/14/14
to max...@googlegroups.com, Matthew Aiello-Lammens
Did this solve all of the connection issues?

I recently switched to win 8.1 and the connection problem seems to persist even though the path and everything is working as it should... What version of Java JDK are you using?

VZG

unread,
Mar 3, 2014, 9:00:13 PM3/3/14
to max...@googlegroups.com, Matthew Aiello-Lammens
Hi All

I have the same problem with Maxent and Java running Biomod. I have tried everything, really everything!! I have even used 6 different computers, including a mac and nothing works. The weird thing is that some model run Maxent and other don't. Also, one day I open my computer and I manage to run one model but then I got the same error in the following ones.

Does someone knows the real issue with this?

Thanks a lot!! I have tried to solve this for a month already :(

Girija Kalyani

unread,
Jul 25, 2014, 2:58:26 AM7/25/14
to max...@googlegroups.com, matt.l...@gmail.com
hey all... the problem could be maxent is using huge amount of memory. So all you need to do is, increase the memory options of java using JVM command line arguments to 1024..Hopefully this should work...

maximilian...@gmail.com

unread,
Jan 31, 2015, 4:05:04 PM1/31/15
to max...@googlegroups.com
Hi! i think that you have the answer for my problem when i try to run maxent in biomod2....however, when i change the memory options in Java, in the message error still says that the amount of memory is 512...could you tell me how can i change this in maxent? Sorry for my impolite english...

vieu....@live.fr

unread,
Nov 14, 2015, 8:57:50 AM11/14/15
to Maxent
Hi all!

I have followed the recomandations from this link:

https://github.com/zoonproject/zoon/issues/87

in the August 20th message of AugustT:


"
Think I got to the bottom of this error. It is because of a space in the file path to the .jar file. This then breaks when it is used in a shell command call to java.

I moved the .jar file to a path without a space and it ran just fine using the code:

myBiomodOption <- BIOMOD_ModelingOptions(MAXENT = list(path_to_maxent.jar = 'C:/Users/tomaug/Documents/maxent.jar'))"


Putting the maxent.jar executable in a folder without space in the path then giving the path through "myBiomodOption" command fixed the problem for me.

I hope this helps!



Reply all
Reply to author
Forward
0 new messages