On the Mac the following environment variables can be set by the launcher code:
JAVA_MAIN_CLASS_<pid> - a string containing the class name which main() methods is called.
JAVA_STARTED_ON_FIRST_THREAD_<pid> - set when the -XstartOnFirstThread is specified on the command line.
APP_ICON_<pid>, APP_NAME_<pid> - set when the corresponding -Xdock:icon or name are specified on the command line.
These variables were first introduced in Apple JDK. Oracle JDK for the Mac continues to use them. The variables are used from libosxapp dynamic library to initialize an instance of the NSApplicationAWT class properly.
While the APP_* and JAVA_STARTED_* are conditional, the JAVA_MAIN_CLASS is set unconditionally. This may cause problems with tests or applications that start another process from the currently running Java app, and want to be able to specify an empty or custom environment for the newly started app.