JDK-6399338 : Java launcher needs more helpful error messages
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Future Project
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-03-16
  • Updated: 2011-02-16
  • Resolved: 2007-01-31
Related Reports
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
If the launcher (java.exe, javaw.exe) encounters an error that could be fixed by reinstalling Java (e.g. missing files, missing registry keys) it should say so in the error messages.

For example, if rt.jar is missing javaw.exe will fail silently. Apparently jvm.dll calls exit(), because it fails to initialize.

One cause for "losing" rt.jar can be Windows System Restore (WSR): If the system is restored to a point prior to uninstalling a JDK/JRE for example this will result in a broken install because WSR does not restore jar files by default.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just delete <install dir>/lib/rt.jar
-or-
uninstall your JDK/JRE and then use WSR to restore your system using the restore point the uninstaller created

then try to execute a jar file using javaw, either by double-clicking a application jar or from a command line.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An error message.
ACTUAL -
No error message.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
When runing java.exe:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

JUSTIFICATION :
A more informative error messages makes it easier for less experienced users to decide how to fix a problem.

Comments
EVALUATION The problem here is that the launcher has no opportunity to show an helpful message as the VM simply exits without passing back control to the launcher, due to CR:5085781. Until that is fixed there is nothing much to do with the launcher.
31-01-2007

EVALUATION If the WSR is the culprit where the JAR files are yet created, then the windows installer should not check point at this "state" instead it should check point when pretty much the install is completed, I am reassigning this to the Installer group for their evaluation.
28-11-2006

EVALUATION While more informative error messages would be helpful, they are difficult to generate for every possible situation of interest.
11-04-2006