Do you have the JAR file in the correct path?

https://mvnrepository.com/artifact/java3d/j3d-core/1.3.1

On Tue, Jan 22, 2019 at 12:51 PM Jennifer Longo <[log in to unmask]> wrote:

Thank you for your tutorial. I've installed and successfully run "Students" via Intellij, however, I am still coming across the same issue regarding java3d when trying to compile projects that require the library (e.g. StudentsWithUI - please see screenshot below). I am about to run some tests but any suggestions you would have for eliminating this error would be greatly appreciated.


Thank you,

Jennifer


From: MASON Multiagent Simulation Toolkit <[log in to unmask]> on behalf of Ernesto Carrella <[log in to unmask]>
Sent: Tuesday, January 22, 2019 4:36:04 AM
To: [log in to unmask]
Subject: Re: Compiling Issue
 
You are right, those tutorials are old.

I wrote a new one for intelliJ (which is what I use); see if this makes sense



On Tue, Jan 22, 2019 at 2:50 AM Jennifer Longo <[log in to unmask]> wrote:

Hi there, thanks for your replay and detailed instructions.


I attempted the steps you listed, and it did work with the basic Student.java file.


However, when I tried to replicate a more complex example with UI (wcss/tutorial14), compiling the java files did work, but attempting to execute resulted in errors relating to classes not being found in linked libraries (terminal screenshot attached)


I also spent a long time attempting to get Eclipse functional. There are only 2 guides I was able to find, both very old

  1. https://cs.gmu.edu/~eclab/projects/mason/extensions/eclipse/
  2. https://docplayer.net/61592708-How-to-set-up-mason-in-eclipse.html
The second one did not seem to handle including necessary libraries such as j3d and jmf, so I spent most of my time on the approach detailed in the first link.


After much time spent figuring out how to include the necessary libraries in the build path, I was finally able to get to a point where I could run the mason project as a Java application, and even was able to see a screen with the full list of available models, yet when trying to launch one of these models, I immediately receive a few errors that I cannot figure out the solution to (attached).


I am unable to proceed past this point.

Any additional help you may be able to offer is extremely appreciated.


Thank you again for your help,

Jennifer




From: MASON Multiagent Simulation Toolkit <[log in to unmask]> on behalf of Ernesto Carrella <[log in to unmask]>
Sent: Friday, January 18, 2019 11:53:49 PM
To: [log in to unmask]
Subject: Re: Compiling Issue
 
Hello there

the immediate fix here is the following. Create a directory that contains both the mason jar file and the Students example. It should look like this:

image.png
Where Students.java is the basic run
import sim.engine.*;
public class Students extends SimState
{
  public Students(long seed)
    {
      super(seed);
    }
  public static void main(String[] args)
    {
      doLoop(Students.class, args);
      System.exit(0);
    }
}

In terminal, within the directory ("testing_mason" in my machine) call the following:
> javac -cp "mason.19.jar:." Students.java
where javac is the compiler call, -cp (classpath) tells mason where to look for libraries and you can use ":" to add multiple paths (; in windows) and Students.java is your code. This will generate a class file:
image.png
Which you can run by calling
java -cp "mason.19.jar:." Students

notice that now we are calling java (without c) and we are pointing to the class name "Students" not any specific file.
This will run. 


However, and I can't stress this enough, this is not how anybody uses MASON(or Java, since the late 90s). This is a tremendous pain for very little gain. Dealing with classpaths is not a useful skill, mucking with -cp flags or environmental variables teaches you nothing and wastes a lot of your time.
Get started immediately on an IDE and do all the examples through it. There used to be a lot of eclipse+MASON guides around, so find one that works for you and do that.
They will take care of all these chores and outside of very lateral cases you will not be bothered by the java machinery at all and you can focus on building and modelling.

On Fri, Jan 18, 2019 at 10:43 PM Jennifer Longo <[log in to unmask]> wrote:

My apologies for the delayed response. Here is a screenshot of my path:What I'm finding to be strange is that I've had it working before. Nothing has changed with the tutorial code or my own code (the unm directory two spots above wcss). I've had to do some run around in order to get the code running, I took direction from here: https://bbs.archlinux.org/viewtopic.php?id=220386 and yet now no matter what I do, the sim.engine is just not being recognized. I really appreciate you all getting back to me. 


Thank you,

Jennifer


From: MASON Multiagent Simulation Toolkit <[log in to unmask]> on behalf of Peter Gacs <[log in to unmask]>
Sent: Wednesday, January 16, 2019 2:15:34 PM
To: [log in to unmask]
Subject: Re: Compiling Issue
 
Currently I am using MASON via the IntelliJ IDE.  There, you can specify a dependency in the Project Structure screen, telling the IDE where it finds the jar files or libraries it needs for compilation.

Peter Gacs

> On Jan 16, 2019, at 14:28 , Jennifer Longo <[log in to unmask]> wrote:
>
> Hello,
>
> I am relatively new working with MASON and am having issues compiling your tutorial code. Using traditional Java methods are yielding an error message of the sim engine not being found. All packages are placed in the correct directories. I have searched and noticed others having similar issues with bio posted solutions that work. Any help would be greatly appreciated.
>
> Best,
> Jennifer


--


--