Open ghost opened 3 years ago
difference between zulu8 and openjdk8: zulu8 has backport of 8157236 ( from ojdk9) and this is the main cause of the isssues here. perhaps it's not a best idea to use jdk's internal api
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f754ada66386
-JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_createAttachFile(JNIEnv *env, jclass cls, jstring path)
+JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_createAttachFile0(JNIEnv *env, jclass cls, jstring path)
Thanks @VladimirKempik .
It seems only if I change my jdk to native oracle jdk or another jdk which doesn't delete the Java_sun_tools_attach_VirtualMachineImpl_createAttachFile
, or I will not run the unit test successfully.
did you find another way to fix it pls? I met the same issue, but our prod use openjdk8, so can't switch to use ojdk.
there is no evidence that 8157236 was backported into openjdk8, it's strange you have the same issue
did you find another way to fix it pls? I met the same issue, but our prod use openjdk8, so can't switch to use ojdk.
Actually,I did find a way to solve this issue. Maybe it is useful for you. When I uninstalled the jdk and tried to reinstall it(just use the package from oracle) , maven noticed me that no jre/jdk was found .I inputed 'echo $JAVA_HOME' in the terminal and no variable was found.And I declared that in my .zsh file and it works
So,what I did is :
Further more,i used the .dmg package , but I don't know why it didn't create $JAVA_HOME automatically.
Actually,I did find a way to solve this issue. Maybe it is useful for you. When I uninstalled the jdk and tried to reinstall it(just use the package from oracle) , maven noticed me that no jre/jdk was found .I inputed 'echo $JAVA_HOME' in the terminal and no variable was found.And I declared that in my .zsh file and it works
I have encountered the same problem. oracle seems provide no support for JKD8-m1 version. So which version did you use? X86_64 or arm64 ?
Actually,I did find a way to solve this issue. Maybe it is useful for you. When I uninstalled the jdk and tried to reinstall it(just use the package from oracle) , maven noticed me that no jre/jdk was found .I inputed 'echo $JAVA_HOME' in the terminal and no variable was found.And I declared that in my .zsh file and it works
I have encountered the same problem. oracle seems provide no support for JKD8-m1 version. So which version did you use? X86_64 or arm64 ?
There was just one install file. plz just download the .dmg file and install it manually.And then, declare the variable $JAVA_HOME in your .zsh config file.
I see the latest version is jdk-8u321-macosx-x64.dmg
I solved this problem. jUnit compile and build chose :/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home(this is your java_home path) not other version. and run , it work!!!
Hi,everyone.
I was trying to execute " mvn clean test " to verify a simple maven project which was generated by "mvn archetype:generate".I just to want learning how to write unit test.But I got an exception , after a long time debug and trying , I don't know how to continue,please give me some advice. Because I don't know what's wrong, so I will try to give as much info as I can.
os:
jdk:
maven: apache-maven-3.8.1(I also tried 3.6.3)
pom.xml:
main java code :
test java code:
stack trace info:
what I have tried: I tried to debug and I got this in class BsdVirtualMachine.class
and it invoke in ClassLoader.class :
It seems a native method createAttachFile(String path) tried to create a file ,and the ClassLoader was trying to load this native method from local, but it can not find this method in /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/libattach.dylib ( I find this by debuging).
with zulujdk's official engineer's help, I found maybe jmockit-1.36.jar is not compatible with m1 chip? or am I wrong? I tried the same os, same chip ,only difference is jdk is native oracle jdk-1.8.0,and this jdk was transferred from my old Mac.Because some jmp bugs, I quit it and try the zulujdk.
I will paste the log file of command (mvn -X clean test )below: test1.log