Skip to content

Avoid Native Access on JDK24+ #15815

@cortlepp

Description

@cortlepp

Description

Currently org.apache.lucene.store.PosixNativeAccess invokes methods that require native access inside it's class constructor, thus always requiring native access. JDK24+ issues a warning when this happens (the warning can be avoided by allowing this specifically) and future versions of the JVM will block the operation by default.

If possible, I would like to avoid having to enable native access for my application which uses Lucene. If I understand the initialization code correctly that should already be possible by denying native access in my JVM, this then only leads to a warning being logged in Lucene. Lucene would afterwards continue to function as if it was on a platform where native access is currently not implemented (e.g. Windows). This would work, but I think it's quite hacky, so I'm wondering if we can make this configurable (opt-in or opt-out) instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions