Main class in jar
Gregg Wonderly
greggwon at cox.net
Mon Mar 5 22:30:42 UTC 2018
But since jar vs module both require a manifest entry or command-line argument to specify the exact thing to “run”, can’t they both inspect the opportunity to act like the other form of command line, and then do the right thing?
The problem is that “uber JARs” (which I have used for decades at this point), used as “applications”, being doubled clicked on, will require there to be this inspection and intelligent execution.
I feel its really important to make this seamless so that people who really do use java as a desktop application environment can provide a single jar to allow users to use the application. Installers are just not something that we need to start the path to have to support cross platform…
Gregg
> On Mar 5, 2018, at 9:40 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> On 05/03/2018 13:58, Gregg Wonderly wrote:
>> Will java -jar note that the argument is a module and help the user understand how to invoke it, or will it just complain about a missing main-class: attribute? From a practical perspective, why does it matter and demand a different command line? What happens when you double click on a module?
>>
> `java -jar` has not changed, it will print an error to say that there is "no main manifest attribute" as it has always done.
>
> If your modules aren't in the run-time image then you have to specify a module path to the java launcher. This is different to `java -jar` where you've packaged everything into a single JAR file (ignoring Class-Path in the this discussion for now). As I said, there is a carry over issue from JSR 376 to examine the topic of executable modular "uber JARs" so I expect it will be re-examined.
>
> I assume by "double on a module" then you mean a JAR file. In that case it depends on how your desktop is configured. Some users may have it configured to run "javaw.exe" with `-jar %1` as the parameters, this would be the equivalent of typing `java -jar ...` on the command line.
>
> -Alan
More information about the jigsaw-dev
mailing list