这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Manas-Dikshit
Copy link

This PR introduces a system property-based mechanism to disable native library loading in NativeView.java. It adds a check for the system property noa.native.disable, allowing users to suppress loading native libraries when required.

🔹 Changes & Fixes:
✅ Implemented System Property Check:

If -Dnoa.native.disable=true is set, the native library loading is skipped.
✅ Fixed Integer Parsing Issues:

Replaced Integer.valueOf() with Integer.parseInt() to prevent unnecessary autoboxing.
✅ Improved Exception Handling:

Wrapped System.load() in a try-catch block to avoid crashes if the library is missing or fails to load.
✅ Ensured Cross-Platform Support:

Adjusted native library path detection for Windows, Linux, and MacOS.
🔹 How to Use the Suppression Feature?
To disable native library loading, run the application with:

bash

-Dnoa.native.disable=true
Example usage:

bash

java -Dnoa.native.disable=true -jar yourApp.jar
With this flag enabled, the system will skip loading native libraries.

🛠️ Why This Change?
This change provides better control over native dependencies and ensures smoother execution in environments where native libraries might not be necessary or available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant