使用32位java编译器生成的.class文件是否可以在64位JVM的64位系统上使用?

时间:2023-01-03 12:26:54

Can a .class file generated using a 32 bit java compiler be used on a 64 bit system with 64 bit JVM?

使用32位java编译器生成的.class文件是否可以在64位JVM的64位系统上使用?

5 个解决方案

#1


6  

Yes. Java byte code is independent from 32/64/... bit systems.

是。 Java字节代码独立于32/64 / ...位系统。

That's the main purpose: the compiled code shall be executable on any system, just the virtual machine is compiled for a special system architecture.

这是主要目的:编译的代码应该可以在任何系统上执行,只是为特殊的系统架构编译虚拟机。

#2


6  

Yes, bytecode is still very high level. There is no distinction between 32 and 64 bit at that level, just as there is no 32 and 64 bit Java code (.java).

是的,字节码仍然是非常高的水平。在该级别上32位和64位之间没有区别,就像没有32位和64位Java代码(.java)一样。

#3


4  

Yes, the 64 bit VM's main difference is access to a larger maximum amount of memory.

是的,64位VM的主要区别是访问更大的最大内存量。

The whole point of Java is that the compiled .class files work on any Java system, no matter the underlying hardware.

Java的重点在于编译的.class文件可以在任何Java系统上运行,无论底层硬件如何。

Your program will work on both a 32 bit and 64 bit system, but, if necessary, provided the hardware and OS is up to the job, your app will be able to access much more memory when running in a 64 bit VM compared with a 32 bit VM.

您的程序将同时适用于32位和64位系统,但是,如果需要,只要硬件和操作系统能够胜任工作,您的应用程序将能够在64位虚拟机中运行时访问更多内存。 32位VM。

#4


2  

Yes, The compiled bytecode is the same between both versions of Java compilers

是的,两个版本的Java编译器之间的编译字节码是相同的

#5


0  

byte code, as the name suggests use byte based instructions, if anything byte code is more 8-bit centric. You should expect the 32-bit compiler and 64-bit compiler to produce the same code.

字节代码,顾名思义使用基于字节的指令,如果任何字节代码更加以8位为中心。您应该期望32位编译器和64位编译器生成相同的代码。

The only difference between the compilers is what is the native bit size for JVM which runs the compiler when it compiles. You shouldn't expect either to perform very differentl except the 64-bit version will not run on a 32-bit OS.

编译器之间的唯一区别是JVM的本机位大小是什么,它在编译时运行编译器。您不应期望执行非常不同的操作,除非64位版本不能在32位操作系统上运行。

#1


6  

Yes. Java byte code is independent from 32/64/... bit systems.

是。 Java字节代码独立于32/64 / ...位系统。

That's the main purpose: the compiled code shall be executable on any system, just the virtual machine is compiled for a special system architecture.

这是主要目的:编译的代码应该可以在任何系统上执行,只是为特殊的系统架构编译虚拟机。

#2


6  

Yes, bytecode is still very high level. There is no distinction between 32 and 64 bit at that level, just as there is no 32 and 64 bit Java code (.java).

是的,字节码仍然是非常高的水平。在该级别上32位和64位之间没有区别,就像没有32位和64位Java代码(.java)一样。

#3


4  

Yes, the 64 bit VM's main difference is access to a larger maximum amount of memory.

是的,64位VM的主要区别是访问更大的最大内存量。

The whole point of Java is that the compiled .class files work on any Java system, no matter the underlying hardware.

Java的重点在于编译的.class文件可以在任何Java系统上运行,无论底层硬件如何。

Your program will work on both a 32 bit and 64 bit system, but, if necessary, provided the hardware and OS is up to the job, your app will be able to access much more memory when running in a 64 bit VM compared with a 32 bit VM.

您的程序将同时适用于32位和64位系统,但是,如果需要,只要硬件和操作系统能够胜任工作,您的应用程序将能够在64位虚拟机中运行时访问更多内存。 32位VM。

#4


2  

Yes, The compiled bytecode is the same between both versions of Java compilers

是的,两个版本的Java编译器之间的编译字节码是相同的

#5


0  

byte code, as the name suggests use byte based instructions, if anything byte code is more 8-bit centric. You should expect the 32-bit compiler and 64-bit compiler to produce the same code.

字节代码,顾名思义使用基于字节的指令,如果任何字节代码更加以8位为中心。您应该期望32位编译器和64位编译器生成相同的代码。

The only difference between the compilers is what is the native bit size for JVM which runs the compiler when it compiles. You shouldn't expect either to perform very differentl except the 64-bit version will not run on a 32-bit OS.

编译器之间的唯一区别是JVM的本机位大小是什么,它在编译时运行编译器。您不应期望执行非常不同的操作,除非64位版本不能在32位操作系统上运行。