Java's native image mode is provided by the GraalVM Native Image tool, which compiles Java applications into platform-specific executables. While this tool offers several benefits such as faster startup times and reduced memory usage, it does not support all features available in the standard Java runtime environment.

Here's a list of examples of features that aren't supported or have limited support in Java's native image mode:

1. Reflection: Native Image has limited support for reflection, and you need to explicitly specify which classes, methods, and fields you want to make available for reflection at build time using a JSON configuration file.

2. Dynamic class loading: Loading classes at runtime using Class.forName() or custom class loaders is not supported, as native images have a closed world assumption where all classes and their dependencies must be known during compilation.

3. Java Native Interface (JNI): There is limited support for JNI, and you need to provide a specific configuration for native methods and libraries during the native image generation process.

4. Finalizers: Native Image does not support finalizers, so you need to find alternatives like using the try-with-resources statement or implementing the AutoCloseable interface.

5. Weak references, soft references, and phantom references: These types of references are not fully supported, and their behavior may differ from the standard JVM.

6. Some JDK APIs: Some JDK APIs, like sun.misc.Unsafe, are not supported or have limited functionality. It's recommended to use alternative APIs or solutions.

7. Just-In-Time (JIT) compilation: Since native images are ahead-of-time (AOT) compiled, there is no JIT compilation at runtime, which may impact the performance of some applications that benefit from runtime optimizations.

8. Java Management Extensions (JMX): Native Image does not support JMX, so you will need to find alternative ways to monitor and manage your application.

9. SecurityManager: Native Image does not support the SecurityManager, and you need to rely on other security measures like proper input validation, secure coding practices, and operating system-level security features.

10. Some garbage collectors: Native Image supports a subset of the garbage collectors available in the JVM, such as the Serial GC and G1 GC. You might need to adjust your application to work with the supported garbage collectors.



Keep in mind that GraalVM Native Image is an evolving technology, and some of these limitations may be addressed in future releases. It is essential to consult the official documentation for the latest information on unsupported features and workarounds.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence