Skip to content
Advertisement

How to run example with simulation package in Java?

Need help to run examples in the JavaSim simulation package.

https://github.com/nmcl/JavaSim

The example Main.java is available at:

examples/src/main/java/org/javasim/examples/basic

Screenshot is attached of the error enter image description here

Note that I also performed in Eclipse:

Right click on the project folder -> Properties Choose ‘Java Build Path’ Click on ‘Sources’ tab on top Click on ‘Add Folder’ on the right panel Selected folder examples and apply

Advertisement

Answer

(problem solved in comment)

There is two project in one, but they are not linked.

The first and global one have a pom.xml file which make the src/main/java folder works and editable. It also make it compile.

In your case, you want to use the “examples” project. This one is NOT linked to the main project. I explain:

You can create a project with multiple sub-project with maven. When you are building the main, all sub are also built according to what you put in the pom.xml file.

Back to your case, the main don’t use the examples as sub-project. So it have to be compilated in a second hand.

If you include the main project, the second will be used as package and not sub-project. Such as you want a new project without the main, you can copy/paste the “examples” folder and use only this one as project.

Now, You can import it in eclipse as Maven project.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement