trustin / os-maven-plugin

A Maven plugin that sets various useful properties detected from ${os.name} and ${os.arch} properties.
Apache License 2.0
296 stars 66 forks source link

Can detects arch for OS, not JDK? #26

Open slavashvets opened 7 years ago

slavashvets commented 7 years ago

When 32-bit JDK is running on 64-bit OS the plugin detects x86_32 arch.

Is there a way to avoid this? As a temporary workaround I do additional check System.getenv("ProgramFiles(x86)") and fix final value.

trustin commented 6 years ago

I'm not sure if this is a good idea given that the primary purpose of this plugin is to use the detected architecture to load .dll or .so. If we returned x86_64 for 32-bit JDK, the chosen shared object will not be loaded.

tresf commented 5 years ago

I'm not sure if this is a good idea given that the primary purpose of this plugin is to use the detected architecture to load .dll or .so. If we returned x86_64 for 32-bit JDK, the chosen shared object will not be loaded.

To the OP's point, if it's being used for building/packaging decisions, it's not necessarily true that the JDK is ever being invoked for a runtime decision. I agree that it should be non-default but I can also see why it would be useful.

trustin commented 3 years ago

I see. Sounds like a good idea to have an option for that, probably from a configuration like this.