Another think which I am trying to understand: once packaged, we invoke the JAR as

java -cp ./myapp.jar org.python.util.jython -jar myapp.jar

My impression was that the "org.python.util.jython" in this line was for specifying the main class, but

If I specify the main class in the manifest like so
Main-Class: org.python.util.jython

and then run 
java -jar ./myapp.jar

I just get the Jython interpreter, instead of the app as defined in __run__,py loading.




On Fri, Dec 6, 2013 at 7:28 PM, mrule <MRule7404@gmail.com> wrote:
Although I got the classpath version working nicely, I decided to move ahead to try to package everything in a single Jar file. I ran into some things that confused me:

-- it seemed like Jython would only find auxillary Java classes if they were in their own package, and that package was part of com or org

-- there doesn't seem to be an easy way to pack resources for Jython in the Jar. The usual Java solution is something like class.getResource, but I couldn't figure out how to use that From jython. What I ended up doing is ... not great, which is create a Resource package in Java with a class called Resources that contains a single static method which wraps the class.getResource functionality. 

I'm sure I just haven't read the right documentation to know how to do this correctly, but I thought I should make a note of this.






On Fri, Dec 6, 2013 at 11:17 AM, Jeff Emanuel [via Python] <[hidden email]> wrote:
Re-zip it using "jar".  You need to make sure to tell jar about the manifest file.



On 12/6/2013 8:46 AM, M.Rule wrote:
Hi all,

I'd like to package a Jython program as a self-contained Windows executable. This is a small project for a user-base that cannot be expected to install/configure Java or Jython, it needs to be really simple. So I guess that means that Jython and Java will be bundled with the application ( much like ImageJ ).

I've been pretty confused about how to "deploy" jython. Yesterday, I tried following this https://wiki.python.org/jython/JythonFaq/DistributingJythonScripts. I got to the point where the tutorial seemed to be asking that I unzip the stand-alone Jython jar, add my project files, re-zip it, and things should work. The only thing is, as soon as I unzip-rezip the stand-alone Jython jar, it breaks ( even if I do not modify its contents ), and Java no longer recognizes it as a valid Jar file.

So, that tutorial doesn't work for me.  It also doesn't get me all the way to a self-contained Windows executable. Does anyone have any leads?

Best, Michael.


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk


_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
To start a new topic under jython-users, email [hidden email]
To unsubscribe from jython-users, click here.
NAML



View this message in context: Re: deploying jython : self contained double-clickable windows executable?
Sent from the jython-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users