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


Groups > comp.lang.java.programmer > #35975 > unrolled thread

javapackager help

Started byKnute Johnson <nospam@rabbitbrush.frazmtn.com>
First post2016-11-26 17:30 -0600
Last post2016-11-27 18:00 -0600
Articles 3 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  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

#35975 — javapackager help

FromKnute Johnson <nospam@rabbitbrush.frazmtn.com>
Date2016-11-26 17:30 -0600
Subjectjavapackager help
Message-ID<o1d5sf$gr3$1@dont-email.me>
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)


Thanks

-- 

Knute Johnson

[toc] | [next] | [standalone]


#35976

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-11-26 21:51 -0500
Message-ID<o1dhn6$1neq$1@gioia.aioe.org>
In reply to#35975
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



[toc] | [prev] | [next] | [standalone]


#35979

FromKnute Johnson <nospam@rabbitbrush.frazmtn.com>
Date2016-11-27 18:00 -0600
Message-ID<o1fs0q$dlu$1@dont-email.me>
In reply to#35976
On 11/26/2016 20:51, Arne Vajhøj wrote:
>
> 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

Well because I'm an idiot.  I couldn't get it to work the usual way so I 
thought maybe I should try the javapackager.  I spent way too much time 
fooling with that before I woke up in the middle of the night with the 
epiphany that I had left out the package statement in my program.  My 
only excuse is that I was up for 28 hours and a little rummy after that 
for a couple of days.

So kindly disregard my post :-)

-- 

Knute Johnson

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web