I read below excerpt from JDK FAQ's
How do I select between 32 and 64-bit operation? What's the default? The options -d32 and -d64 have been added to the Java launcher to specify whether the program is to be run in a 32 or 64-bit environment. On Solaris these correspond to the ILP32 and LP64 data models, respectively. Since Solaris has both a 32 and 64-bit J2SE implementation contained within the same installation of Java, you can specify either version. If neither -d32 nor -d64 is specified, the default is to run in a 32-bit environment.
Now to test this, I logged in into my 64 bit Ubuntu guest OS and installed 64 bit JDK version - Linux x64 165.24 MB jdk-8u45-linux-x64.tar.gz
.
After installing the JDK, when I run my java program using -d64
then everything is as expected because it is in fact a 64 bit installation but when I use -d32
then I get error saying Error - This Java instance does not support 32 bit JVM
.
Error is understandable to me, but what confuses me is this line (as in above quoted para) "The options -d32 and -d64 have been added to the Java launcher to specify whether the program is to be run in a 32 or 64-bit environment."
As per this line, my understanding is that when launching Java of 64 bit version, -d32
can be used to launch it in 32 bit mode.
Questions:
java
then whichever installation (32 bit or 64 bit JDK) is in my PATH will be launched.Java do-while loop is used to execute a block of statements continuously until the given condition is true. The do-while loop in Java is similar to while loop except that the condition is checked after the statements are executed, so do while loop guarantees the loop execution at least once.
A "for loop" is a specialization of a "while" loop (or, for that matter, a "do/while" loop). You can do everything in a while loop that you can in a for loop. You can also nest loops, one inside another.
While loop in Java comes into use when we need to repeatedly execute a block of statements. The while loop is considered as a repeating if statement. If the number of iterations is not fixed, it is recommended to use the while loop.
Both for loop and while loop is used to execute the statements repeatedly while the program runs. The major difference between for loop and the while loop is that for loop is used when the number of iterations is known, whereas execution is done in the while loop until the statement in the program is proved wrong.
The citation you made:
The options -d32 and -d64 have been added to the Java launcher to specify whether the program is to be run in a 32 or 64-bit environment.
is valid only for the Solaris operating system.
Later in the JDK's FAQ, we can read:
All other platforms (Windows and Linux) contain separate 32 and 64-bit installation packages. If both packages are installed on a system, you select one or the other by adding the appropriate "bin" directory to your path. For consistency, the Java implementations on Linux accept the -d64 option.
So to answer your second question, in Windows and in Linux, theses flags are useless and the 32/64 bit selection is done by running the corresponding JVM installation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With