Running Jason applications in Eclipse

Viewed 433

When I want to run my .mas2j file in Eclipse, I always have to right click the file and then select "Run as Jason application". Is there a way to add a shortcut to do this?

2 Answers

Jason's "Run" button should be added to eclipse toolbar ("Step 14" of jason eclipse-plugin installation guide) and it is supposed to work. Anyway, you can save some time using shell, following instructions in jason's github page:

git clone https://github.com/jason-lang/jason.git
cd jason
gradle config

And run a project using a command like bellow:

jason examples/gold-miners-II/miners.mas2j

Another way, and actually my recommendation is moving to JaCaMo (which has Jason embedded). JaCaMo offers a gradle script for your projects. You can easily download JaCaMo from the repository and create a project from zero in one shot (first, go to your project root folder and then type):

curl -s -O http://jacamo.sourceforge.net/nps/np07.gradle
gradle -b np07.gradle --console=plain

After downloading JaCaMo, the script will ask you to type a name for your project, for instance, "test". So, go to "test" folder and type:

gradle run

The just created JaCaMo project should launch after this command. Besides good compiling performance, another advantage is that gradle will manage package dependencies.

This is usually the issue with uncategorized commands in Eclipse. I had the same issue with the Run JaCaMo Application option. In order to see all your plugin commands:

Go to Preferences -> General -> Keys. Click on Filters... and de-select Filter uncategorized commands then Ok.

Then you should be able to find the desired command in the Command list and add a preferred Binding.

Note: If Eclipse offers a command, it should be listed in the pop-up window that appears when hitting the Show a table of all available commands button of the Oomph toolbar. The table shows all the available commands, where you can find them, and all the defined shortcut keys.

Related