Starter template for building FMUs using FMU4j.
Download and install a JDK version 8:
- https://adoptopenjdk.net/
- https://docs.aws.amazon.com/de_de/corretto/latest/corretto-8-ug/downloads-list.html
- https://www.openlogic.com/openjdk-downloads
- https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html
- add the java installation folder (aka JAVA_HOME) and JAVA_HOME\jre\bin\server (should contain libjvm.dll) to the PATH variable
Linux (add to .bashrc)
export JAVA_HOME="java installation folder"
export PATH=$JAVA_HOME/bin:$PATH
# $JAVA_HOME/jre/lib/amd64/server should contain libjvm.so
export LD_LIBRARY_PATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib/amd64/server:$LD_LIBRARY_PATH
- Implement an instance of
Fmi2Slave
. See https://github.com/Vico-platform/fmu4j_template/blob/main/src/main/java/example/JavaSlave.java - Specify the fully qualified class name of the FMUs you have implemented in the
fmu4j
closure inbuild.gradle
. Note that multiple FMUs can be implemented and built within the same project.
gradlew.bat build fmu
./gradlew build fmu
This should create the FMU(s) in build/fmus