New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exported Linux sketches must be run from the sketch folder #1046

Closed
processing-bugs opened this Issue Feb 10, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@processing-bugs

processing-bugs commented Feb 10, 2013

Original author: jwmatt...@gmail.com (March 07, 2012 08:34:54)

In Processing 2.0a4, Ubuntu 11.10:

Sketches with loadFont() export incorrectly. If the application is launched from outside the application.linux folder, a NullPointerException is thrown.

  1. Create a simple sketch with a vlw file in data folder:
    //start sketch
    PFont font;
    font = loadFont("FreeSans-24.vlw");
    text("test",50,50);
    //end sketch
  2. Export application
  3. Open terminal, try:
    cd ~; ./export_test/application.linux/export_test

java.lang.NullPointerException
at java.io.DataInputStream.readInt(DataInputStream.java:370)
at processing.core.PFont.<init>(Unknown Source)
at processing.core.PApplet.loadFont(Unknown Source)
at export_test.setup(export_test.java:20)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Exception in thread "Animation Thread" java.lang.RuntimeException: Could not load font FreeSans-24.vlw. Make sure that the font has been copied to the data folder of your sketch.
at processing.core.PApplet.die(Unknown Source)
at processing.core.PApplet.die(Unknown Source)
at processing.core.PApplet.loadFont(Unknown Source)
at export_test.setup(export_test.java:20)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

NOTES: No error occurs when launched from within the application.linux folder.
File is confirmed to be in data folder.

The bug fix listed here does not fix the problem: http://code.google.com/p/processing/issues/detail?id=945&amp;q=application%20export&amp;colspec=Stars%20ID%20Type%20Status%20Priority%20Owner%20Summary

Original issue: http://code.google.com/p/processing/issues/detail?id=1008

@processing-bugs

This comment has been minimized.

Show comment
Hide comment
@processing-bugs

processing-bugs Feb 10, 2013

From f...@processing.org on March 26, 2012 22:19:07
This is because the script that starts the sketch doesn't know how to find the data folder if you're not in the same working directory of the sketch. It's not a good script. We've sorted this (I believe) with the main Processing script, if someone would like to help fix it.

The change is that we're no longer bundling the entire data folder contents into the exported .jar file, because it's unnecessary and inefficient and sometimes slows sketches down when the data files are very large.

processing-bugs commented Feb 10, 2013

From f...@processing.org on March 26, 2012 22:19:07
This is because the script that starts the sketch doesn't know how to find the data folder if you're not in the same working directory of the sketch. It's not a good script. We've sorted this (I believe) with the main Processing script, if someone would like to help fix it.

The change is that we're no longer bundling the entire data folder contents into the exported .jar file, because it's unnecessary and inefficient and sometimes slows sketches down when the data files are very large.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Feb 4, 2015

Member

Fixed via #3083

Member

benfry commented Feb 4, 2015

Fixed via #3083

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment