Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35976

Re: javapackager help

From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: javapackager help
Date 2016-11-26 21:51 -0500
Organization Aioe.org NNTP Server
Message-ID <o1dhn6$1neq$1@gioia.aioe.org> (permalink)
References <o1d5sf$gr3$1@dont-email.me>

Show all headers | View raw


On 11/26/2016 6:30 PM, Knute Johnson wrote:
> So as best I can tell, if I want to create a JAR file with my JavaFX
> program in it, I have to use javapackager?  I'm having a little
> difficulty.  Could anybody give me an example command line if I have my
> main file is in com/mypackage/MyProgram and another class is in
> com/another/AnClass.
>
> I tried cd to directory above com and:
>
> javapackager -createjar -appclass com.mypackage.MyProgram -srcdir
> com/mypackage -srcfiles *.class -srcdir com/another -srcfiles *.class
> -outdir com/mypackage -outfile MyProgram -v
>
> What I get is:
>
> Exception in thread "main"
> com.sun.javafx.tools.packager.PackagerException: Inva
> lid directory C:\Users\Knute Johnson\com\mypackage\com\another\classes
>         at com.sun.javafx.tools.packager.Main.main(Main.java:217)

I suspect that you would need to use:

javapackager -createjar -appclass com.mypackage.MyProgram -srcdir bin 
-outfile MyProgram -v

to take:

bin/com/mypackage/*.class
bin/com/another/*.class

and create MyProgram.jar.

But why not just create a normal executable jar with a main
class like you have always done.

That approach works for JavaFX as well.

Arne



Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

javapackager help Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-11-26 17:30 -0600
  Re: javapackager help Arne Vajhøj <arne@vajhoej.dk> - 2016-11-26 21:51 -0500
    Re: javapackager help Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-11-27 18:00 -0600

csiph-web