From Java, is it possible to get the complete commandline with all arguments that started the application?
System.getEnv()
and System.getProperties()
do not appear to contain the values.
From Java, is it possible to get the complete commandline with all arguments that started the application?
System.getEnv()
and System.getProperties()
do not appear to contain the values.
Have a look at YAJSW (Yet Another Java Service Wrapper) - it has JNA-based implementations for various OSes (including win32 and linux) that do exactly this so it can grab the commandline for a running process and create a config that wraps it in a service. A bit more info here.
There is a environment variable %~dp0 which returns the complete path