javamacosintellij-ideahotswap

dyld: Symbol not found: _JVM_CopySwapMemory


I was setting up my development environment for a java application using java 8u202, HotSwapAgent 1.3.0, DCEVM 8u181 and IntelliJ on a MacOS machine. Everything worked fine for a few days when suddenly this error appeared:

dyld: lazy symbol binding failed: Symbol not found: _JVM_CopySwapMemory Referenced from: /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/libjava.dylib Expected in: /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/dcevm/libjvm.dylib

dyld: Symbol not found: _JVM_CopySwapMemory Referenced from: /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/libjava.dylib Expected in: /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/dcevm/libjvm.dylib

I've tried reinstalling JDK, replace JVM by DCEVM not just install DCEVM as an alternative JVV but none of these solutions worked.

Does anyone knows what could cause this or how to solve it?


Solution

  • The JVM_CopySwapMemory is a new method exposed by the OpenJDK JVM from the January 2019 update.

    JVM_CopySwapMemory(JNIEnv *env, 
                       jobject srcObj, 
                       jlong srcOffset,
                       jobject dstObj,
                       jlong dstOffset, 
                       jlong size,
                       jlong elemSize)
    

    This means you need a specific patch file to compile the DCEVM project by yourself, if, indeed, a patch is available.

    Unfortunately the latest binary release is compatible only with 8u181, not with 8u202.