public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* trouble packaging jars
@ 2014-05-06 19:05 mikel evins
  2014-05-06 20:56 ` Alcides Flores Pineda
  0 siblings, 1 reply; 5+ messages in thread
From: mikel evins @ 2014-05-06 19:05 UTC (permalink / raw)
  To: kawa; +Cc: mikel evins, per

I'm using Kawa to write a networked 3D game built on JavaMonkeyEngine. The combination works great. It performs extremely well, and enables us to add and modify features extremely rapidly with very compact code.

Now I want to figure out how to package our classes in executable jars. That's turning out to be more difficult than I anticipated. I've been unable to get the kawac ant task to work outside of the kawa sources. I've tried using plain old Makefiles and using kawa as a compiler, which works fine, but for some reason I end up unable to figure out the right class or classpath to put in the manifest.

Is anyone else doing interactive development with Kawa and then building the results into a standalone jar? If so, I'd love to pick your brain about how you set up the jar builds. So far, examining kawa's own buildfile and sources has not helped the light dawn.

I suppose I should mention I'm not exactly new to doing this. I've packaged executable jars many times before from sources in several different languages--Java, Scala, Clojure, and even--ten years or so ago--Kawa itself. However, it has been a couple of years since the last time, so there's a good likelihood that I'm just forgetting something simple.

I don't want to spew tons of details about all the stuff I've tried so far--your eyes would glaze over--but, just briefly, the project consists of a set of library jars (including kawa itself), and the Scheme sources of the game client and server. We use Emacs to run kawa, and we run the game processes from the repl. This enabls us to inspect and interact with the game server and client in real time, while they're running. Kawa's performance is great for this stuff; we can go from a cold start to a running game client in a couple of seconds; we can change meshes, lighting, animation, and whatever in real time while the game runs; we can kill the client or server, change something, and be back in the game in a couple of seconds.

Very briefly, I've tried using the kawac ant task, but I can't seem to figure out how to use it outside kawa's source tree. I can point it at kawa's tools directory and then ant can find the definition of the Kawac class, but then it complains that it can't find kawa.repl, and nothing I've tried (i.e. all sorts of path-like structures pointing to where the kawa jar is) fixes that problem.

I've tried running kawa from a Makefile to compile the scheme sources to classfiles, and that works well enough, but then I can't seem to figure out a way to package them with a manifest so that java can find the main class. Yes, I compiled with kawa --main, and yes, when I jar ft the jarfile, the main class is where the manifest says it is, but java complains just the same that it can't find od load the class.

Thanks in advance for any help or advice.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trouble packaging jars
  2014-05-06 19:05 trouble packaging jars mikel evins
@ 2014-05-06 20:56 ` Alcides Flores Pineda
  2014-05-06 21:04   ` mikel evins
  2014-05-06 21:10   ` mikel evins
  0 siblings, 2 replies; 5+ messages in thread
From: Alcides Flores Pineda @ 2014-05-06 20:56 UTC (permalink / raw)
  To: mikel evins; +Cc: kawa, per

Hello Mikel

I've written a little demo & proof of concept application here: 
- https://github.com/alcidesfp/swing-kawa
to teach myself howto compile and create distributable jars with Kawa.
Its a basic ("Hello World") GUI (Swing) application.

Maybe the build.xml and the scripts there can help you and/or give you
some ideas.

Greetings.
-- 
Alcides Flores Pineda.

On Tue, May 06 2014, mikel evins wrote:

> I'm using Kawa to write a networked 3D game built on JavaMonkeyEngine. The
> combination works great. It performs extremely well, and enables us to add
> and modify features extremely rapidly with very compact code.
>
> Now I want to figure out how to package our classes in executable
> jars. That's turning out to be more difficult than I anticipated. I've
> been unable to get the kawac ant task to work outside of the kawa
> sources. I've tried using plain old Makefiles and using kawa as a
> compiler, which works fine, but for some reason I end up unable to figure
> out the right class or classpath to put in the manifest.
>
> Is anyone else doing interactive development with Kawa and then building
> the results into a standalone jar? If so, I'd love to pick your brain
> about how you set up the jar builds. So far, examining kawa's own
> buildfile and sources has not helped the light dawn.
>
> I suppose I should mention I'm not exactly new to doing this. I've
> packaged executable jars many times before from sources in several
> different languages--Java, Scala, Clojure, and even--ten years or so
> ago--Kawa itself. However, it has been a couple of years since the last
> time, so there's a good likelihood that I'm just forgetting something
> simple.
>
> I don't want to spew tons of details about all the stuff I've tried so
> far--your eyes would glaze over--but, just briefly, the project consists
> of a set of library jars (including kawa itself), and the Scheme sources
> of the game client and server. We use Emacs to run kawa, and we run the
> game processes from the repl. This enabls us to inspect and interact with
> the game server and client in real time, while they're running. Kawa's
> performance is great for this stuff; we can go from a cold start to a
> running game client in a couple of seconds; we can change meshes,
> lighting, animation, and whatever in real time while the game runs; we can
> kill the client or server, change something, and be back in the game in a
> couple of seconds.
>
> Very briefly, I've tried using the kawac ant task, but I can't seem to
> figure out how to use it outside kawa's source tree. I can point it at
> kawa's tools directory and then ant can find the definition of the Kawac
> class, but then it complains that it can't find kawa.repl, and nothing
> I've tried (i.e. all sorts of path-like structures pointing to where the
> kawa jar is) fixes that problem.
>
> I've tried running kawa from a Makefile to compile the scheme sources to
> classfiles, and that works well enough, but then I can't seem to figure
> out a way to package them with a manifest so that java can find the main
> class. Yes, I compiled with kawa --main, and yes, when I jar ft the
> jarfile, the main class is where the manifest says it is, but java
> complains just the same that it can't find od load the class.
>
> Thanks in advance for any help or advice.
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trouble packaging jars
  2014-05-06 20:56 ` Alcides Flores Pineda
@ 2014-05-06 21:04   ` mikel evins
  2014-05-06 21:10   ` mikel evins
  1 sibling, 0 replies; 5+ messages in thread
From: mikel evins @ 2014-05-06 21:04 UTC (permalink / raw)
  To: Alcides Flores Pineda; +Cc: mikel evins, kawa, per


On May 6, 2014, at 3:56 PM, Alcides Flores Pineda <alcides.fp@gmail.com> wrote:

> Hello Mikel
> 
> I've written a little demo & proof of concept application here: 
> - https://github.com/alcidesfp/swing-kawa
> to teach myself howto compile and create distributable jars with Kawa.
> Its a basic ("Hello World") GUI (Swing) application.
> 
> Maybe the build.xml and the scripts there can help you and/or give you
> some ideas.

Thanks very much! That's just what I was hoping for. With luck, I can use it to figure out where I went wrong.

--me


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trouble packaging jars
  2014-05-06 20:56 ` Alcides Flores Pineda
  2014-05-06 21:04   ` mikel evins
@ 2014-05-06 21:10   ` mikel evins
  2014-05-06 21:41     ` Alcides Flores Pineda
  1 sibling, 1 reply; 5+ messages in thread
From: mikel evins @ 2014-05-06 21:10 UTC (permalink / raw)
  To: Alcides Flores Pineda; +Cc: mikel evins, kawa, per


On May 6, 2014, at 3:56 PM, Alcides Flores Pineda <alcides.fp@gmail.com> wrote:

> I've written a little demo & proof of concept application here: 
> - https://github.com/alcidesfp/swing-kawa
> to teach myself howto compile and create distributable jars with Kawa.
> Its a basic ("Hello World") GUI (Swing) application.
> 
> Maybe the build.xml and the scripts there can help you and/or give you
> some ideas.

Woops. The build fails:

$ ant
Buildfile: /Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml

BUILD FAILED
/Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml:37: The entity name must immediately follow the '&' in the entity reference.

Total time: 0 seconds

So I found and fixed the ampersand and tried again. I see the same problem I've been having:

$ ant
Buildfile: /Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml

gui:
    [javac] Compiling 1 source file
     [kawa] Error: Could not find or load main class kawa.repl

BUILD FAILED
/Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml:44: Java returned: 1

Total time: 0 seconds


If your buildfile is really working, it suggests that I may have some local configuration issue. What version of ant and of the JDK are you using?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trouble packaging jars
  2014-05-06 21:10   ` mikel evins
@ 2014-05-06 21:41     ` Alcides Flores Pineda
  0 siblings, 0 replies; 5+ messages in thread
From: Alcides Flores Pineda @ 2014-05-06 21:41 UTC (permalink / raw)
  To: mikel evins; +Cc: kawa, per

Hi.

I've corrected the "&" error (recently introduced)
You need to have the kawa JAR (v.gr: kawa-1.14.jar) renamed or symlinked
to kawa.jar in the lib directory for the build to run as is, otherwise
you need to edit the build.xml to use the
- path/name/of/your/kawa-version.jar 

I forgot to put that in the README (its updated now)

With this in place, the build runs fine.
I've just run & tested it using kawa-1.14 and java 7 (1.7.0_25)

> ~/Projects/afp/swing-kawa-master$ ant
> Buildfile: /Users/devel/Projects/afp/swing-kawa-master/build.xml
>  
> gui:
>      [kawa] (compiling gui/MyApp.scm to gui.MyApp)
>  
> src:
>      [kawa] (compiling main.scm to main)
>  
> BUILD SUCCESSFUL
> Total time: 2 seconds

I hope this helps
-- 
Alcides Flores Pineda

On Tue, May 06 2014, mikel evins wrote:

> On May 6, 2014, at 3:56 PM, Alcides Flores Pineda <alcides.fp@gmail.com> wrote:
>
>> I've written a little demo & proof of concept application here: 
>> - https://github.com/alcidesfp/swing-kawa
>> to teach myself howto compile and create distributable jars with Kawa.
>> Its a basic ("Hello World") GUI (Swing) application.
>> 
>> Maybe the build.xml and the scripts there can help you and/or give you
>> some ideas.
>
> Woops. The build fails:
>
> $ ant
> Buildfile: /Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml
>
> BUILD FAILED
> /Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml:37: The entity name must immediately follow the '&' in the entity reference.
>
> Total time: 0 seconds
>
> So I found and fixed the ampersand and tried again. I see the same problem I've been having:
>
> $ ant
> Buildfile: /Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml
>
> gui:
>     [javac] Compiling 1 source file
>      [kawa] Error: Could not find or load main class kawa.repl
>
> BUILD FAILED
> /Volumes/ymra/Attic/Software/Languages/Scheme/kawa/swing-kawa/build.xml:44: Java returned: 1
>
> Total time: 0 seconds
>
>
> If your buildfile is really working, it suggests that I may have some local configuration issue. What version of ant and of the JDK are you using?
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-06 21:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 19:05 trouble packaging jars mikel evins
2014-05-06 20:56 ` Alcides Flores Pineda
2014-05-06 21:04   ` mikel evins
2014-05-06 21:10   ` mikel evins
2014-05-06 21:41     ` Alcides Flores Pineda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).