I have the most recent version of Java installed and it works fine in Eclipse and with other programs.
A Duke University online course wants me to download and run their flavor of BlueJ for Windows. I installed it, but it can't launch. It says:
Could not create the Java virtual machine
On Windows, BlueJ comes bundled with a Java Development Kit, JDK, so
only a single download is needed.
Download the Duke/Coursera specific version (choose Save instead of Run)
Double-click the downloaded install file and follow the wizard to install it in your preferred location
By default, the installer will place a shortcut to BlueJ on your desktop
C:\Program Files (x86)\BlueJ>BlueJ.exe > tmp.txt
Error occurred during initialization of VM Could not reserve enough
space for 2097152KB object heap
SET JAVA_OPTS="-Xms256m -Xmx512m"
At long last I got this working.
The trick was to set the initial -- not maximum and not initial and maximum -- heap size in
_JAVA_OPTIONS to a very small value, which I believe is because BlueJ insists on using 32-bit Java even though 64-bit is available:
Note that the same setting in
JAVA_OPTS did no good.
If you have a deeper understanding of why this is and would like to submit a better version of this answer then please do so and I'll mark your answer as the solution.