ByteBuffer considered not existing in JDK 22
Michael Hall
mik3hall at gmail.com
Sun May 12 18:25:18 UTC 2024
> On May 12, 2024, at 4:58 AM, Martin Pernollet <martin.pernollet at protonmail.com> wrote:
>
> Hi,
>
> Two additional useful information
> this happens with macOS JDK only (tried ARM but not x86). No problem with Windows and Linux
> I get the problem both from Eclipse and when building from command line with Maven :
I can’t recreate but I definitely notice a change
java -version
openjdk version "22.0.1" 2024-04-16
OpenJDK Runtime Environment (build 22.0.1
Installed and now jdk 22 is default.
outputdir/HalfPipe.app/Contents/MacOS/HalfPipe
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/mjh/HalfPipe/HalfPipe_jpkg/outputdir/HalfPipe.app/Contents/app/libhp.dylib: dlopen(/Users/mjh/HalfPipe/HalfPipe_jpkg/outputdir/HalfPipe.app/Contents/app/libhp.dylib, 0x0001): tried: '/Users/mjh/HalfPipe/HalfPipe_jpkg/outputdir/HalfPipe.app/Contents/app/libhp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/mjh/HalfPipe/HalfPipe_jpkg/outputdir/HalfPipe.app/Contents/app/libhp.dylib' (no such file), '/Users/mjh/HalfPipe/HalfPipe_jpkg/outputdir/HalfPipe.app/Contents/app/libhp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
My app is broken on native lib access.
java -cp outputdir/HalfPipe.app/Contents/app/halfpipe.jar org.cmdline.cmds.showc java.nio.ByteBuffer
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
at java.base/java.lang.System.setSecurityManager(System.java:431)
at org.cmdline.psuedoGestalt.GestaltClasses.<clinit>(GestaltClasses.java:54)
at org.cmdline.cmds.showc.main(showc.java:72)
showc: invoked with: java.nio.ByteBuffer
public abstract class java.nio.ByteBuffer extends java.nio.Buffer implements java.lang.Comparable {
// Constructors
java.nio.ByteBuffer(byte[], long, int, java.lang.foreign.MemorySegment);
java.nio.ByteBuffer(int, int, int, int, java.lang.foreign.MemorySegment);
java.nio.ByteBuffer(int, int, int, int, byte[], int, java.lang.foreign.MemorySegment);
// Fields
private static final long ARRAY_BASE_OFFSET;
…
I do find java.nio.ByteBuffer
java -cp outputdir/HalfPipe.app/Contents/app/halfpipe.jar set os.arch
os.arch=x86_64
Java current architecture on my silicon machine?
/usr/libexec/java_home -v 21 --exec java -cp outputdir/HalfPipe.app/Contents/app/halfpipe.jar set os.arch
os.arch=aarch64
The prior architecture where my application ran.
Why the change?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240512/f9e93c60/attachment.htm>
More information about the panama-dev
mailing list