matsim-libs
matsim-libs copied to clipboard
Error when running carsharing from JAR file
Hello, I'm trying to run carsharing module from JAR files.
So I have generated JAR files using : mvn package -DskipTests
.
I'm getting an error :
Error: Unable to initialize main class org.matsim.contrib.carsharing.runExample.RunCarsharing
Caused by: java.lang.NoClassDefFoundError: org/matsim/core/population/routes/RouteFactory
when executing : java -Xmx32g -cp path_to_carsharing-15.0-SNAPSHOT.jar org.matsim.contrib.carsharing.runExample.RunCarsharing path_to_config.xml
Could you please help me to solve this issue ?
Thanks.
Hello,
Unfortunately, you cannot run carsharing or any other contrib by using these JARs directly. My advice would be to create your own project and add the necessary dependencies. In your case matsim and carsharing and then package this project as a standalone JAR.
You can find the example project pom here