Skip to content

The Dockerfile for building masoudkf/java-jade image. The image can be used to compile and run JADE-based applications.

Notifications You must be signed in to change notification settings

masoudkarimif/java-jade-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

This is the source Dockerfile for the masoudkf/jade-java repository on DockerHub. The image can be used for both compiling and running JADE-based applications.

⚠️ Warning: The official JADE website appears to be down at the time of this writing. As a result, the image uses another repo to build JADE .jar file. I downloaded JADE's source code a while back, and now that the official website is down, I've put everything in this repo.

Compile

Pull the image:

docker pull masoudkf/java-jade

Move to your project directory:

cd <Your-Project-Directory>

Write your agent:

cat >./HelloWorld.java <<EOL
import jade.core.Agent;

public class HelloWorld extends Agent
{
    protected void setup()
    {
        System.out.println("Hello World!");
        System.out.println("My name is "+ getLocalName());
    }
}
EOL

Compile your files:

docker run -v $(pwd):/app --name jade-test --rm masoudkf/java-jade

This will put the compiled files in the current directory. The default command is javac -d . *.java. If you want to run a different command for compiling, you can add it to the command above. You can also add files to the CLASSPATH environment variable by passing the CP env in the run command.

docker run -v $(pwd):/app --name jade-test -e CP=./mylib.jar --rm masoudkf/java-jade javac MyFile.java

Run

Run this command after compiling your files:

docker run -v $(pwd):/app --name jade-test --rm masoudkf/java-jade java jade.Boot -agents hwagent:HelloWorld

You should see this output:

Hello World!
My name is hwagent

About

The Dockerfile for building masoudkf/java-jade image. The image can be used to compile and run JADE-based applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published