A linked answer tells how to make a typical JFrame-based app maximize on start, but the question here is, can we signal to an app via java -jar
that it is supposed to be maximized?
Short answer: not without recompiling the Java app.
Longer answer: either we pass environment from the batch runtime or a property via the JVM we are invoking such that an app knows it is being asked to maximize itself. That is, we provide logic that checks for environment or a runtime property and invoke the GUI startup in a specific manner. Alternatively, we have the app itself take options and simply pass that option to it when we want it maximized.
I could also be wrong, if something like the start command works as described in another answer.
Update: I can confirm that start /MAX java -jar ...
will sort of, but not really, work. It will maximize the java.exe window that is launched, but the GUI components within that will not be maximized.
There may be some shell trick that you can use here but I think it's a bit of a fool's errand. Any shell hack will end up being brittle and release specific. At the end of the day the GUI component that is actually in charge of displaying itself has little or no concept of platform specific requests like these.
This is a fundamental difference between so-called "native" GUI apps and apps that run via a virtual machine.