A collection of useful information related to Java debugging, troubleshooting, and general use of products that run in a JVM. None of the commands/procedures warrant their own post (too short), so this simply aggregates a bunch of useful blips of information into a single post. Platform is specified to indicate the platform the process was tested on, but the process will very likely work on other platforms as well.
Enable Logging/Tracing for Java Web Start Application
Platform: OSX, Linux
To enable the logging/tracing capability of a Java Web Start application, two different procedures
can be used (may be more, these are the most useful I’ve found). After performing one of the following
procedures and starting the application, log files and trace logging should be able to be found in
the following directory: ~/.java/deployment/log/*
Option 1: Control Panel (System-Level Enable)
This procedure will enable logging/trace for the system Java (all applications that are run):
Option 2: Application Configuration (Application-Specific Enable)
This procedure will enable logging/trace for a specific application:
Error Attempting to Run JNLP
Platform: OSX
When attempting to run a JNLP file, if clicking the file opens the Apple Store or displays messages such as “Bad Installation. No JRE found in configuration file”, then run the following command to fix the issue:
Switching Java Version on Mac OSX
Platform: OSX
Upgrading Java on Mac OSX can be somewhat cumbersome. Upon one attempt, I installed a newer version of the
Java SE and changed the symlink in /System/Library/Frameworks/JavaVM.framework/Versions
to point to the
newer version (rather than A
):
After doing so and attempting to run an application, I received the following response from Java:
To address this, I needed to re-configure the symlink contained within the Java VM frameworks directory such
that it would continue to report to the A
version:
I then used the Java Preferences Application to update the current version of Java, and updated my .bash_profile to include the following:
Case and point - don’t update your Java version by hand on OSX - the system Java installed and managed is not as flexible to manipulate as it would be on a *nix system.
Keystore for Java - Re-import with Updated Key Password
Platform: Linux
To manage Java keystores, the following commands are useful for getting certificates/keys and updating passwords:
Java Heap Dump
Platform: Linux
To perform a Java Heap dump (for investigating memory):