I am trying to use JEP to communicate with a python module from Java. I am using intellij on MacOS catalina I have done the following
Used pip to install JEP, installation directory is
/Applications/anaconda3/lib/python3.8/site-packages/jep/Add the path as an environment variable in .zshrc file
export LD_LIBRARY_PATH='/Applications/anaconda3/lib/python3.8/site-packages/jep/'
I am getting the error(from intellij) in this line
Jep jep = new Jep();The error that I am getting is this
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Applications/anaconda3/lib/python3.8/site-packages/jep/libjep.jnilib:dlopen(/Applications/anaconda3/lib/python3.8/site-packages/jep/libjep.jnilib, 1): Library not loaded: @rpath/libpython3.8.dylibIf I package the code in jar ,and run it as java -jar somejar.jar It gives an error
Error: Unable to initialize main class Application Caused by: java.lang.NoClassDefFoundError: jep/JepException
6.My build.gradle file looks like this
dependencies {
// https://mvnrepository.com/artifact/black.ninia/jep
implementation group: 'black.ninia', name: 'jep', version: '3.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}

If it helps the original poster, or anyone else who comes across this post:
If you have followed all of the advice here and still get the
UnsatisfiedLinkError, make sure your pythonjepinstall is the same version as the version listed in your pom.xml