Print

Print


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: 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: 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://secure-web.cisco.com/1wKUQsg0q1bWPdaAyP7m-cg51GsvJuFT-RhQ2h45T9YBXS8eqwSoIQex468la5wZCFCFwMH6WPGsm75RLaNwKjWrQCSuvXgXFupVqMWUzUUVTZoeTU0f5ofTAwYmOYL-k3JuHDOwfx1UGTpfj_rM9pMlfHoE_Ou81Z-kPTSR493aT7NgnuRpKpogRG55UV5HzXoF0jZcq3NlScb8bejcgl-wbjbNc0xOaRZuQE6nTy7KyDyiUgRY4h43zedXSJmAxZGQav54xrbGIFp5NjWfiSyEjjEnZRx-U1gFw9VVFkfuCg1GbCB2nMLXZJNnYV9cmSBUJz7gEzhq9D8OisfKPteaDvDr6mUhjVr_VVtHiTLIwF7yNGDH6t9Dg5PgIR1xwfg2FxPW7mLeXjH2lhYuoisnKy_AtEDIEryebjtHgUk3nMkx5dgXsywm_bQZqskYIyqJq7grRMa5YeXkhaBI-2g/https%3A%2F%2Fbbs.archlinux.org%2Fviewtopic.php%3Fid%3D220386
> <https://secure-web.cisco.com/16-7E8vG0VqPDMBIv4r94JeGpIJY-rWeGop-KEqGkcUa8Iqyr40Da_YQfUvOniXyZbSCBmJ-d3kzirOJ_SuaH2ufL7Isii9-bkHIZLTmdSyqxMJiuT9MHjNa9e8xscKbU-E02G6NVEakifurOCr-XGaQp5tY6cVdsuqxSA83YXIpLjoVSp0sum4wTf0y__8x33YmGBjXw8cEVuTOHuMCFCMO-CKMZ3KJW3mS80obAtrjfEU2fxA55U9c1rmUcXgzRZqgEOpAcEBHbfvVZ5I8T-zA2Nt6GJ6Ud29ovZP5Bbs3BFxKdOvqeOs9oQQAY5r3HXTrsd3cBmYkIWGnL1shXOgLzTElwvwjmsimqVzuoUqMfAvqo5G2PCh8cSeI9acQuy87-uXNzlNVW44Oxn_0JPLxUWyb3kKzoI1xbxkN5uqpJH7vgQhJ_o4W9mb677XVBSoh2HKOc0JitVivxmhbYmw/https%3A%2F%2Fbbs.archlinux.org%2Fviewtopic.php%3Fid%3D220386> 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
>


-- 
Ernesto Carrella
http://secure-web.cisco.com/1562ifeoOT72dlamK3r83vzdIyaa60nlh9fC55VkOXkH4rsEFHIKqEq1pKepBEhhjf-yXsXnla5T0RciD3wIQpVHooh3PBrh8mfj_7Axhebo6rYbzSOiRijCKtWSoC33Jw3Q_SP2AraFMZ4xu9X2u06hvm8ecU5geVfoHUOzP-LxzCjRuyNW9t0PblzvzCdbP0iP4XG3OWZkUoj1IHB-w1N1trdyQXmQ26vmUA07kyFY1Qnih0_iI2nqEmo_3oOr-7oZhnv9h4jHxdHxDjmPrZuibvtjgOvYns9rm9-O0QTYLaQqB4pnt_LK7vLuFLe69kizmDzXn5Fm0gsuHYjDRKUJjpZRHm4feLsQq5A2iY3WtrW82PLK4TNoeiFUgzzGdL_pawxIQZjFSssh8mxlF7f3TEYFUBymv0ww2tK2Dptf6UJAZgxTvFOCg5bc7cDrAuQkwNvZC3wFAarG9DSdYDmGJdWmlKUMG4ePgPpopkWc/http%3A%2F%2Fcarrknight.github.io%2F