Closed ncollier closed 3 months ago
Problem is NOT with the batch runs themselves but rather with running the ant task that configures and executes the batch run. The xmltask jar that we use in there references unexported modules. Adding this
--add-exports java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED --add-exports java.xml/com.sun.org.apache.xpath.internal.objects=ALL-UNNAMED
to the launcher for the model / batch GUI seems to fix the issue. More testing required to know for sure.
Note --add-opens seems to work as well.
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
Adding the above --add-exports to JZombies launch configurations fixes the issue. I'm going to try to contact the original poster and see if this solves it for them. If fix works, then need to add those args to RSProjectConfigurator lines 53 and 56.
Adding those parameters to the launchers seems to fix the issue. For the distributed model (Builder Installer for
The Eclipse launch configuration for batch runs already includes these VM args (including the one required by #88, if we need that). We need to update the RS runtime launch config to include these via RSProjectConfigurator.VMARGS and .BATCH_VMARGS. We should also update the start_model.bat and start_model.command in the r.s.eclipse/setupfiles/installer.
Apply fix to the following locations:
Working JVM options for Java 17:
-XX:+IgnoreUnrecognizedVMOptions
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-modules=ALL-SYSTEM
--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
--add-exports=java.desktop/sun.awt=ALL-UNNAMED
--add-exports=java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-exports=java.xml/com.sun.org.apache.xpath.internal.objects=ALL-UNNAMED
--add-exports=java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
vm args formatted for bat and model files:
start_model.bat:
-XX:+IgnoreUnrecognizedVMOptions --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-modules=ALL-SYSTEM --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xpath.internal.objects=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
start_model.command:
-XX:+IgnoreUnrecognizedVMOptions \
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
--add-modules=ALL-SYSTEM \
--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED \
--add-exports=java.desktop/sun.awt=ALL-UNNAMED \
--add-exports=java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-exports=java.xml/com.sun.org.apache.xpath.internal.objects=ALL-UNNAMED \
--add-exports=java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
Updated repast simphony: 3cc7df65 Updated models: https://github.com/Repast/repast.simphony.models/commit/fbc9f87538dc1999769282233041fc41f33b0e0e
Add the required arguments for Java 17 to prevent IllegalAccess exceptions (e.g. --add-opens/=ALL-UNNAMED) when running in batch mode.