1

I'm trying to use javacpp-presets for LLVM, but there appears to be a link time issue: whenever I try to run my program, I get an error

"Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniLLVM in java.library.path" I'm on a Windows 10 machine.

The follwing is my code

package baecompiler;
//boilerplate code https://github.com/bytedeco/javacpp-presets/tree/master/llvm
//so we can play with LLVM code generation
// General stuff
import org.bytedeco.javacpp.*;

// Headers required by LLVM
import static org.bytedeco.javacpp.LLVM.*;

public class LLVMExperiment {

    public static void main (String[] args) {

        BytePointer error = new BytePointer((Pointer)null); // Used to retrieve messages from functions

        LLVMLinkInMCJIT(); //the line it fails on

        ....
howie
  • 2,587
  • 3
  • 27
  • 43

1 Answers1

1

Add -Djava.library.path=x to your command line where x is the full path to the jniLLVM.dll file.

Sean F
  • 4,344
  • 16
  • 30