How can I tell if a jar was compiled on a 64bit or

2020-02-06 05:32发布

I have a jar but I don't know if it is a .jar for a 64bit system or for a 32bit system. How to find that out?

EDIT: My .jar has native library dependency.

标签: java
3条回答
smile是对你的礼貌
2楼-- · 2020-02-06 05:46

That's beauty of JVM and platform independence means. There is no value to 32bit or 64bit when it comes to Java, JVM, Jar etc.

查看更多
够拽才男人
3楼-- · 2020-02-06 05:49

Java bytecode is java bytecode, it doesn't matter whether it was built with a 32-bit or 64-bit JDK and there is no way to figure this out.

I think it does not make any difference to have a jar compiled with 32-bit or 64-bit. It should be machine-independent; unless you have some native library dependency or the java code is directly being compiled to native code.

查看更多
Evening l夕情丶
4楼-- · 2020-02-06 06:01

A pure jar is not compiled to a particular architecture.

A 32 bit JVM will run the jar in 32 bit, likewise a 64 bt JVM will run the jar in 64 bit.

Of course, if your jar uses native libraries then the 'bitness' of these will have to match the JVM that you use to run the jar.

查看更多
登录 后发表回答