Skip to content

faq 108171095

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

How to run .java example scripts?

by Florian Zenoni on 2017-03-01 12:39:12


Dear experts,

I originally asked the question in another thread (https://matsim.atlassian.net/wiki/questions/108073357/how-to-run-the-parking-extension), but I have copied it here for visibility.

Being a newbie not only in MATSim, but also in Java and Eclipse, the following questions are rather basic, so I apologize in advance for that.

As I wanted to implement the parking extension, I modified the example project (0.9.0-SNAPSHOT branch), and I think I correctly modified the pom.xml, replaced the HelloWorld.java with RunParkingSearchExample.java, corrected the paths to the input files, and imported everything in Eclipse. Alongside I have placed the necessary .xml files to run the simulation, but I feel that it is not the correct place. Indeed Eclipse gives me the following error when I try to execute the project:

JAR entry src/main/ressources/network.xml not found in /home/fzenoni/.m2/repository/org/matsim/contrib/parking/0.9.0-SNAPSHOT/parking-0.9.0-SNAPSHOT.jar

What am I supposed to do know? What is the actual role of the .java? I used some other extensions before, such as the NetworkEditor, and I could run everything from command-line only providing input .xml files. What is the difference with that case? What am I missing?


Edit: Apparently I made a bit of a progress, but I am not sure what I changed with respect to before. I have attached the logfile.log. Is there anything wrong in there?</ac:plain-text-link-body></ac:link>

Edit2: The logfile attached above was produced by right-clicking on the full project, and running it as a Java Application, then invoking the GUI and giving the config.xml file as an input. As an output, no events are simulated, as if the RunParkingSearchExample.java was ignored (it is there, in fact, that plans and parking facilities are referred, not in the config.xml itself).

Instead, executing RunParkingSearchExample.java as a Java Application (always through Eclipse) I get the Code Block shown above in my original message. Why is the program looking for input xml files in the .m2/ directory? Is it expected?


Comments: 0

Clone this wiki locally