Is there a better alternative for -cp/CLASSPATH ?
Timothy Madden
terminatorul at gmail.com
Wed Dec 21 16:29:09 UTC 2011
On 14.12.2011 12:00, Fernando Cassia wrote:
> On Tue, Dec 13, 2011 at 13:21, Timothy Madden<terminatorul at gmail.com> wrote:
>> Is there a way to launch java applications (classes), without having to know
>> and to specify where the .class files are installed all the time ?
>
> Yes, One-Jar.
>
> My favorite Java apps (desktop Java) are properly packaged as a single
> .jar file and can be run by just issuing java -jar appname.jar.
>
> I think Sun should have made One-Jar part of the JDK and its use mandatory.
>
> http://one-jar.sourceforge.net/
>
> Fiddling with the classpath feels so 1990s...
And is there a way to launch such a jar from PATH for example, or
without knowing the specific install location ?
I vaguely remember there was some way to add a new executable format to
a system (user-mode only), but I am not sure that making all .jar files
a directly "executable" format, like ELF/PE ones, is appropriate or is
good practice. Maybe a .jar file will override some existing system
command this way...
Thank you,
Timothy Madden
More information about the discuss
mailing list