JPAN development requires:
- JDK 8 or later
- Maven
- An IDE
JPAN builds are tested on
- Windows 11 with Java 8
- MacOS with Java 21
- Ubuntu 20.04 with Java 8, 11, 17 and 21
Setting up Java and Maven on MacOS can be tricky, so here are some pointers:
Prerequisites
- Java JDK 8 (=1.8) or later. This can be confirmed by running
java -version
andjavac -version
(if the versions differ, check yourJAVA_HOME
environment variable, see below). - Maven. This can be confirmed by running
mvn -version
Good instructions for installing Java and Maven can, for example, be found here. Otherwise, you can follow the instructions below.
If JDK is missing or not working (usually it should be installed, but may require some setup to work in a console):
- If
java -version
works andjavac -version
works and report the same version then the JDK is properly installed already. Please continue with installing Maven. - Make sure that
brew
is installed, see for example here. - Check with
brew search jdk
weather a JDK is already installed. If no JDK is installed, install one of the options, e.g.brew install oracle-jdk
. - Ensure that
JAVA_HOME
points to the JDK home directory. Check withecho $JAVA_HOME
. Set it with e.g.export JAVA_HOME=/Library/Java/Java/VirtualMachines/jdk-22.jdk/Contents/Home
wherejdk-22.jdk
can vary depending on your JDK version. Best add this line to your.zshrc
file.
Maven is usually not installed. You can follow the instructions here) or install it with brew:
- Make sure Xcode is installed
- Install maven with
brew install maven
- Checkout the source code:
git clone https://github.com/scionproto-contrib/jpan.git
- Compile with
mvn install -DskipTests=true
- Run with
mvn exec:java -Dexec.mainClass="org.scion.jpan.demo.ScmpEchoDemo"