Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

jvm

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

like image 540
user518796 Avatar asked Jan 24 '11 09:01

user518796


2 Answers

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

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.

like image 112
Andreas Dolk Avatar answered Oct 20 '22 17:10

Andreas Dolk


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).

like image 6
rob g. Avatar answered Oct 20 '22 15:10

rob g.