Java installation, Rosetta error

After I install Java on my Mac I am getting the below error when I try to check the Java version.

 % java -version   

rosetta error: /var/db/oah/223263137464320_223263137464320/b0347cf8ea34da6748ab1aa2798ae3173ec7284920af0dc3926a4f3708749972/java.aot: attachment of code signature supplement failed: 1

zsh: trace trap  java -version

I believe this can be fixed by finding the m1 version of this java version (If there is one). Hope that helps.

I'm running into the same issue, I've used the openJDK 17 as well as a few other ARM compatible versions.

rosetta error: /var/db/oah/223263137464320_223263137464320/0aa89f1a02cccbd42fb9a80d986a0f1c06f16c3d6162e2c159fd22dd601ebd15/libxcrun.dylib.aot: attachment of code signature supplement failed: 1

Java installation, Rosetta error
 
 
Q