Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2022-02-10 to 1 day

C argv[0] equivalent for Java

In C, you can get the name of the binary file called from the shell with argv[0]. In Java, it seems there is no obvious way to get the equivalent: the name of the class that has the entry-point main() class. I made three options, but none …