Closed runemadsen closed 6 years ago
I can reproduce this. I had not tried exporting the app. Very weird, because it mentions win32 even if you're on Mac and I'm on Linux. I'll take a look.
Thanks Abe! I’m a bit dumbfounded too. Let me know if there’s anything I can do to help. On Sun, 11 Feb 2018 at 7:08 PM Abe Pazos notifications@github.com wrote:
I can reproduce this. I had not tried exporting the app. Very weird, because it mentions win32 even if you're on Mac and I'm on Linux. I'll take a look.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hamoid/video_export_processing/issues/47#issuecomment-364743118, or mute the thread https://github.com/notifications/unsubscribe-auth/AALuFVb4SGpUSWWAYRGupU5HFeCJiHdzks5tTsoqgaJpZM4SBNCQ .
I asked in the Processing forum. I'm not an expert in Java packaging and related issues. I tried printing some debug info from the library and from the sketch, but there's no output, so I believe java is encountering this issue before starting the program.
I'll search for something like #ifdef for java, to see if I could remove code from the source when running certain platforms.
Ok I found one workaround. Look at the launch script. In my case it's called basic
. It's missing both jna.jar
and jna-platforrm.jar
. I added them manually and then the app can be launched.
Before (for a script called basic):
#!/bin/sh
APPDIR=$(readlink -f "$0")
APPDIR=$(dirname "$APPDIR")
java -Xms64m -Xmx2048m -Djna.nosys=true -Djava.library.path="$APPDIR:$APPDIR/lib" -cp "$APPDIR:$APPDIR/lib/basic.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-amd64.jar:$APPDIR/lib/gluegen-rt-natives-linux-amd64.jar:$APPDIR/lib/VideoExport.jar" basic "$@"
After:
#!/bin/sh
APPDIR=$(readlink -f "$0")
APPDIR=$(dirname "$APPDIR")
java -Xms64m -Xmx2048m -Djna.nosys=true -Djava.library.path="$APPDIR:$APPDIR/lib" -cp "$APPDIR:$APPDIR/lib/basic.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-amd64.jar:$APPDIR/lib/gluegen-rt-natives-linux-amd64.jar:$APPDIR/lib/jna.jar:$APPDIR/lib/jna-platform.jar:$APPDIR/lib/VideoExport.jar" basic "$@"
So I just added :$APPDIR/lib/jna.jar:$APPDIR/lib/jna-platform.jar
somewhere in that long line.
UPDATE: I forgot to mention that I threw those two libraries inside the lib folder too. I'll figure out if I can automate this in the library.
Should be fixed now. Please re-open if not :)
Thank you so much for the quick turnaround. Will investigate tonight!
It seems like the library wasn't updated in the Processing library manager. Is that something I can help make happen?
I just manually copied version 2.2
into my libraries folder, and I'm still having the same problem with my exported Mac application. I'm wondering whether I made a mistake or the bug is not fixed. Will poke around for a bit and update this issue.
Hi! :) So I was having exactly the same issue you have on my Linux laptop. I figured out the reason was that the jna.jar
and jna-platform.jar
were not included and not referenced in the exported app.
In linux, the exported app is a folder that contains a launch script. This script now also includes references those two libraries.
Thanks again for being so responsive. I checked my Mac app package, and it has a ton of .jar
files in its Java
folder, but those two are missing. There are two core root files in the app – Pkginfo
and Info.plist
but they don't list .jar
files at all. Hmmmm, I guess it's time for me to actually start learning about Mac app packages. If I copy the JAR's into the Java
folder, it works. So Processing seems to not know about these two JAR's. @shiffman, would you know?
You're welcome :)
In the library folder you manually installed, do you see a library
folder that contains jna.jar jna-platform.jar VideoExport.jar
?
If they are in this folder, I assume those jars should be copied when the application is exported.
Do you see any of those three files in the Mac app package? In Linux these files are part of the exported application:
core.jar
gluegen-rt.jar
gluegen-rt-natives-linux-amd64.jar
interactive.jar
jna.jar
jna-platform.jar
jogl-all.jar
jogl-all-natives-linux-amd64.jar
VideoExport.jar
Hi hamoid and runemadsen. I've made some tests also in windows 10 and the same problem with the Export Application in Windows 10. Downloaded new 2.2 version and copied jar files and doesn't work. Any update?
Hi @Mantecoder, I have now access to Win 10 and OS X so I'll try them there see what I discover.
Thanks a lot! If I may help you testing something just say me.
I tried in Windows 10 and it worked fine for me.
Where does it differ for you @Mantecoder ?
I'll try in OSX next.
@runemadsen I tried on Mac OS 10.12.6 (Sierra) and it worked fine. I downloaded processing 3.3.6, ffmpeg was already installed, I added the Video Export Library, run the Basic example successfully, then I exported that example as an app, and it also run fine by double clicking on the app.
What could be the difference? Could you try with the Basic example too? Is there maybe some unexpected interaction with other parts of your project? Do you use many libraries? Different OS?
Hmm, interesting. Here's my import list:
import processing.svg.*;
import java.util.UUID;
import processing.pdf.*;
import com.hamoid.*;
import javax.swing.*;
I'll give it a try with the basic example, but it's good to know that this is local to my project.
Okay, this completely beats me, but it suddenly started working. I have not changed anything or updated neither Processing or VideoExport. Hmmm....
Would be nice to know why, but at least we know that the passing of time has a positive effect on this one :) I'll close it until it shows up again :)
Deal. Thanks for being so responsive! 👍
This library works perfectly when building from the IDE, but when I run it from an application, I get:
I'm using Processing 3.3.6 and it crashes on the following line:
Any thoughts on this? I'm running Java version 9.0.4.