// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;

public class CommandLine {
    public static void main(String[] args) {
        RuntimeMXBean rtmb = ManagementFactory.getRuntimeMXBean();
        for(String s : rtmb.getInputArguments()) {
            System.out.println(s);
        }
        System.out.println(rtmb.getClassPath());
        System.out.println(CommandLine.class.getProtectionDomain().getCodeSource().getLocation().getPath());
    }
}
