Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I realized what the problem was and I wanted to document it in case anyone else has the same problems.</p> <p>I was using the jython.jar file that came in the standard installation of Jython, and NOT the standalone jython.jar (the instructions at <a href="https://wiki.python.org/jython/JythonFaq/DistributingJythonScripts#Using_the_Jar_Method" rel="nofollow noreferrer">Using the Jar Method</a> mentions this, but the instructions at <a href="https://wiki.python.org/jython/JythonFaq/DistributingJythonScripts#Building_jars_-_some_samples" rel="nofollow noreferrer">Building Jars</a> do not). I am still unsure why copying the Lib/ folder of the standard installation into the jython.jar that came with that installation didn't work on my system. However, once I used the standalone jar, things started to work more smoothly.</p> <p>Additionally, I was able to get my library to work with the packaged file by doing three things in addition to the steps I laid out in my question: </p> <ol> <li><p>Exploding the standalone jython.jar and copying the folder with all of my library files into Lib, then create a new jar. This seemed to be the easiest way to include my library and allows me to package everything into a single jar.</p></li> <li><p>I discovered after reading Frank Wierzbicki's answer in <a href="https://stackoverflow.com/questions/1681849/why-does-jython-refuse-to-find-my-java-package">Why does Jython refuse to find my Java package?</a> that because I am now using the standalone jar, I could no longer use imports of the style <code>from java.awt import *</code>, instead I needed to fully specify each thing I was importing, for example <code>from java.awt.Font import PLAIN, BOLD, ITALIC</code>. So I went through the library's imports and fixed the few that were of the wrong style.</p></li> <li><p>Now that I am adding my Library directly to the Jar's Lib folder, instead of writing <code>Class-Path: ./myLibrary.jar</code> in <code>othermanifest.mf</code>, I put <code>Main-Class: org.python.util.JarRunner</code> as per Frank Wierzbicki's answer in the post I mentioned in my question: <a href="https://stackoverflow.com/questions/1252965/distributing-my-python-scripts-as-jars-with-jython">Distributing my Python scripts as JAR files with Jython?</a></p></li> </ol> <p>This allowed me to create a double-clickable executable jar containing my library and jython file that I wanted to run.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload