JDK-7047602 : javaw launcher needs to improve error reporting
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 7
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2011-05-23
  • Updated: 2018-10-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorUnresolved
Related Reports
Relates :  
Relates :  
Description
��When running command line launcher:
$ java -Xmx1000g -classpath "$ANT_HOME/lib/ant-launcher.jar" "-Dant.home=$ANT_HOME" org.apache.tools.ant.launch.Launcher

We got the detailed message:
Invalid maximum heap size: -Xmx1000g
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

However, with the same command, javaw.exe just give a generic error dialog and just exit, without details about what causing the error.

This affect both developer and end-user of javaws tool, which internally invoke javaw.
Please see also CR 6684582, which was closed without a actual fix committed or fix without general solution?

Comments
This should really be a P4.
28-01-2014

I am moving this to 9, we don't have time do this in 8, this is somewhat complex fix involving the JVM communication.
07-05-2013

WORK AROUND However if you are in a shell capable of redirecting stderr you can do this: javaw.exe -Xmx1000g foo > java.log 2>&1 then you will see the error messages. If a program like javaws is execing javaw then it should be able to capture the stderr as above and display it to the user or log it somewhere.
24-05-2011

EVALUATION The difference between java and javaw is that javaw uses WinMain which unlike java.exe (uses a unix like main) has no notion of stderr and stdout. Thus in the case of javaw the stderr by default is "/dev/null". Unfortunately it is not quite apparent to the average user, the issue is that the message about the heap is being emitted from the jvm to the stderr. All the launcher has at this time is a JNI failure, so it is reporting that via the MessageBox. There is a need in the future to have some text buffers to be used bethween the launcher and the vm for purposes like this and other things. This is definitely not in the scope of jdk7.
24-05-2011