It would be nice to have a command to download a jar file and put it on the path. Right now, one must download and unzip the jar file, and then add the unzip directory to the jython path.
# cd /tmp/jcodec/
# wget -N http://jcodec.org/downloads/jcodec-0.1.9.jar
# jar xvf jcodec-0.1.9.jar
import sys
sys.path.append("/tmp/jcodec/")
instead:
addToSearchPath( sys.path, 'http://jcodec.org/downloads/jcodec-0.1.9.jar', monitor )
See the cookbook entry about "Jython Search Path"
This should allow a zip containing a .jar to be accessed, for example:
addToSearchPath('http://www.trieuvan.com/apache//commons/math/binaries/commons-math3-3.6.1-bin.zip/commons-math3-3.6.1/commons-math3-3.6.1.jar', monitor )
This would contain the logic to extract the jar, if necessary unpack the jar, and then put it on the search path.
Note the code should work with any Autoplot:
Last edit: Jeremy Faden 2018-03-05
See also https://sourceforge.net/p/autoplot/feature-requests/583/
I needed something to decode ico files:
For some reason the above script works with a fresh Autoplot launch, but this script doesn't:
Actually... Sometimes the above example (2017-10-08) doesn't work. I start a fresh jumbojar version and it's not working.
Last edit: Jeremy Faden 2017-11-26
I need to get this into the nightly tests. I was hoping this script would work:
I've spent some time with this this morning. Some commented code, claiming to be unneeded was needed, and single-jar releases support this now.
On webstart I get:
java.security.AccessControlException: java.security.AccessControlException: access denied ("java.io.FilePermission" "/home/jbf/autoplot_data/jython/org/apache/commons/math3/random/Well19937c.class" "read")
Here's the script I was using:
Last edit: Jeremy Faden 2018-03-07
I used this successfully when getting materials ready for Kris' AGU talk.
This does not work with github releases, like https://github.com/jamesmudd/jhdf/releases/download/v0.8.3/jhdf-0.8.3.jar:
I fixed the problem with github releases, using downloadFileToTempFile when the FileSystem approach does not work.
See also https://sourceforge.net/p/autoplot/bugs/2632/.