-
-
Notifications
You must be signed in to change notification settings - Fork 236
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 erros - I already tried some solutions #2241
Comments
Hi,
We are sorry you have encountered this problem. I will explain how I got things to work on a MacOS system 14.4.1.
I was able to run nlrx version 0.4.4 – May 16, 2023 with
R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
and NetLogo 6.4.0 with gis extension 1.3.3
You should unzip the attached file in your home directory (or modify this info appropriately).
nlrx needs to be able to find the gis extension
I did this by creating a soft link to it from the directory containing my model
The commands below were entered at a bash terminal prompt ">"
cd ~/nlrx-gis
ln -s "/Applications/NetLogo 6.4.0/extensions/.bundled/gis" .
if you cannot set symbolic links you can copy the equivalent of the gis directory specified above to your model directory, but that is not desirable. See https://stackoverflow.com/questions/75638168/nlrx-netlogo-cant-find-the-gis-extension/75653910#75653910
You may need to edit the file nrlx-setup.R
If you are not using a MacOS system with standard NetLogo 6.4.0 installation you must update the variable netlogopath several lines below to use the correct location
You may need to modify the modelpath and outpath to your model, and the output directory respectively if your system does not recognize the use of “~” for the home directory.
The output directory must exist before running the script.
You can then execute the following code in an R terminal.
R> setwd('~/nlrx-gis')
R>source('nlrx-gis-setup.R')
The output file should be created in the ~/nlrx-gis/nlrx-output directory.
Notes on things you ran into.
GIS version 1.3.3 requires at least NetLogo 6.3.0. As of NetLogo 6.3.0 all code, including extensions is compiled using Java 17. Java 17 class files are version 55.0 while Java 8 class files are versions 52.0. That’s what the java.lang.UnsupportedClassVersionError means. NetLogo bundles its own Java environment, so it doesn’t require you to specify JAVA_HOME. I believe nlrx gives a warning message if you haven’t specified JAVA_HOME.
Please let us know if you need more help. If this works for you please close the issue, or let us know.
Thanks,
Aaron
…--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling
From: Rogério ***@***.***>
Date: Monday, April 15, 2024 at 8:24 AM
To: NetLogo/NetLogo ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [NetLogo/NetLogo] Java erros - I already tried some solutions (Issue #2241)
Hello,
I have already posted this on the GitHub page for the nrlx package, but I am coming here to ask for any ideas on how to solve this problem.
I have a model that was built in 6.2.1, which uses the GIS extension, but when opening the NetLogo program itself, it shows the following error:
java.lang.UnsupportedClassVersionError: org/myworldgis/netlogo/GISExtension has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
What I have already done:
* I uninstalled Java 8 and installed Java 11, but it didn't work;
* I changed the Java folder destination in the .cfg file to the Java 11 directory, however, the error that occurred with the GIS extension now occurs with the VID extension. I cannot set up the model in either situation.
The only way I can run the model (in nrlx) is by using 6.2.1 and setting JAVA_HOME to the Java 11 directory. However, the problem is that I need to see if my turtles are filling the geographical space of the model, which I can’t do in nrlx, only in the Netlogo itself.
Does anyone have any idea how to resolve this? At this point, I don't even know what to do, as I have always used 6.4.0 without any major issues, and it seems that this version is not recognized in the nrlx package.
Thank you.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/NetLogo/NetLogo/issues/2241__;!!Dq0X2DkFhyF93HkjWTBQKhk!Xam5nlKrdo7O_uuaw1Lq7AuyObuR6JHOsfhUV8zFA1_dVVI82Q6Gx3FRkJDfgm4gMqlXcFprgerS7aPQYWpqZU6qVCv5jJ3kGw$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ANSUO2RGZ6JZT7IVALZD3O3Y5PBGJAVCNFSM6AAAAABGHH3BV2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DGNJUGUZTENY__;!!Dq0X2DkFhyF93HkjWTBQKhk!Xam5nlKrdo7O_uuaw1Lq7AuyObuR6JHOsfhUV8zFA1_dVVI82Q6Gx3FRkJDfgm4gMqlXcFprgerS7aPQYWpqZU6qVCskkuOTYA$>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Just to clarify a bit, NetLogo is compiled with Java 17, but it uses compatibility flags so it should also run with Java 11 (except for the macOS GUI). Java 11 class file version is 55.0. Java 17 class file version is 61.0. I would recommend using Java 17 if possible, though.
When running through nlrx NetLogo will use whatever Java nlrx is using, the bundled Java for NetLogo shouldn't matter. |
Hello,
I have already posted this on the GitHub page for the nrlx package, but I am coming here to ask for any ideas on how to solve this problem.
I have a model that was built in 6.2.1, which uses the GIS extension, but when opening the NetLogo program itself, it shows the following error:
java.lang.UnsupportedClassVersionError: org/myworldgis/netlogo/GISExtension has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
What I have already done:
I uninstalled Java 8 and installed Java 11, but it didn't work;
I changed the Java folder destination in the .cfg file to the Java 11 directory, however, the error that occurred with the GIS extension now occurs with the VID extension. I cannot set up the model in either situation.
The only way I can run the model (in nrlx) is by using 6.2.1 and setting JAVA_HOME to the Java 11 directory. However, the problem is that I need to see if my turtles are filling the geographical space of the model, which I can’t do in nrlx, only in the Netlogo itself.
Does anyone have any idea how to resolve this? At this point, I don't even know what to do, as I have always used 6.4.0 without any major issues, and it seems that this version is not recognized in the nrlx package.
Thank you.
The text was updated successfully, but these errors were encountered: