Console for Exported Application (Windows); Command Line Jar Execution; Application Export
in
Core Library Questions
•
2 years ago
According to a post on the old forums, when you run an exported processing application from the command line, it shows you the console output of the application. I need this in order to troubleshoot why a sketch runs under processing but not as an application
I'm having trouble launching the application from a console. Here's what I'm doing:
The blue highlight part is the path to java, the red part is the path to Feed_Reader.jar, the green part is supposed to make java recursively search the directory for required libraries. I don't think this is the right argument or it's missing information because it can't "find the main class: Feed_Reader.
Also, is this accurate for getting console output from an application? The application is called Feed_Reader.exe and when I run that, there's no output to the console.
The sketch uses the following libraries and was running as an application with these libraries.
import net.obxlabs.romefeeder.*; //romefeeder
import com.sun.syndication.feed.synd.*; //ROME
import controlP5.*;
Since I was able to last export as an application, I've added the following features:
I recently added functions using import prohtml.*; but I don't think think this is incompatible with applications.
I also recently added a data = loadStrings(URL) function since last testing the sketch as an exported application. I notice from reference that, "The filename parameter can also be a URL to a file found online. For security reasons, a Processing sketch found online can only download files from the same server from which it came. Getting around this restriction requires a signed applet."
I'm trying to run my sketch as an application and browser security restrictions requiring a signed applet in order to run as an applet should not affect it when running as an application, right?
My last idea is that I vaguely recall reading something about how classes need to be properly declared in order to run as an application, that pde's are more tolerant than apps which need classes to be declared as Public or something in order to work as applications. Unfortunately, I forgot where I read this. I do know that it hasn't worked as an exported application since adding a few classes, e.g.:
I'm having trouble launching the application from a console. Here's what I'm doing:
- C:\IG-Files\projects\sketchbook\Feed_Reader\application.windows>"C:\Program File
- s (x86)\Java\jre6\bin\java" -jar C:\IG-Files\projects\sketchbook\Feed_Reader\app
- lication.windows\lib\Feed_Reader.jar -Djava.ext.dirs=c:\IG-Files\projects\sketch
- book\Feed_Reader\application.windows\lib\
- Exception in thread "main" java.lang.NoClassDefFoundError: processing/core/PAppl
- et
- at java.lang.ClassLoader.defineClass1(Native Method)
- at java.lang.ClassLoader.defineClassCond(Unknown Source)
- at java.lang.ClassLoader.defineClass(Unknown Source)
- at java.security.SecureClassLoader.defineClass(Unknown Source)
- at java.net.URLClassLoader.defineClass(Unknown Source)
- at java.net.URLClassLoader.access$000(Unknown Source)
- at java.net.URLClassLoader$1.run(Unknown Source)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.net.URLClassLoader.findClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- Caused by: java.lang.ClassNotFoundException: processing.core.PApplet
- at java.net.URLClassLoader$1.run(Unknown Source)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.net.URLClassLoader.findClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- ... 12 more
- Could not find the main class: Feed_Reader. Program will exit.
The blue highlight part is the path to java, the red part is the path to Feed_Reader.jar, the green part is supposed to make java recursively search the directory for required libraries. I don't think this is the right argument or it's missing information because it can't "find the main class: Feed_Reader.
Also, is this accurate for getting console output from an application? The application is called Feed_Reader.exe and when I run that, there's no output to the console.
The sketch uses the following libraries and was running as an application with these libraries.
import net.obxlabs.romefeeder.*; //romefeeder
import com.sun.syndication.feed.synd.*; //ROME
import controlP5.*;
Since I was able to last export as an application, I've added the following features:
I recently added functions using import prohtml.*; but I don't think think this is incompatible with applications.
I also recently added a data = loadStrings(URL) function since last testing the sketch as an exported application. I notice from reference that, "The filename parameter can also be a URL to a file found online. For security reasons, a Processing sketch found online can only download files from the same server from which it came. Getting around this restriction requires a signed applet."
I'm trying to run my sketch as an application and browser security restrictions requiring a signed applet in order to run as an applet should not affect it when running as an application, right?
My last idea is that I vaguely recall reading something about how classes need to be properly declared in order to run as an application, that pde's are more tolerant than apps which need classes to be declared as Public or something in order to work as applications. Unfortunately, I forgot where I read this. I do know that it hasn't worked as an exported application since adding a few classes, e.g.:
- class Clock {
- float d, mm, wCen, hCen, Cir, CirR1, CirR2, CirR3;
- String f;
- PFont b;
- Clock(int _wCen, int _hCen, int _Cir){
- wCen = _wCen;
- hCen = _hCen;
- Cir = _Cir;
- b = loadFont ("Andalus-48.vlw");
- }
- void display() {
- smooth();
- stroke(255);
- fill(130);
- textFont(b,32);
- int d = day();
- int mm = month();
- int yy = year();
- String f = nf(mm,2) + "." + nf(d,2) + "." + nf(yy,4);
- text(f,wCen-80, hCen+90);
- // time
- // wCen = width-((width/4)+50);
- // hCen = height/2;
- //Cir = 150;
- CirR1 = Cir/3;
- CirR2 = Cir/2.5;
- CirR3 = Cir/4;
- fill(200);
- float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI;
- float m = map(minute(), 0, 60, 0, TWO_PI) - HALF_PI;
- float h = map(hour()% 12, 0, 12,0, TWO_PI) - HALF_PI;
- stroke(194);
- ellipse(wCen, hCen, 16, 16);
- strokeWeight(2);
- line(wCen, hCen, cos(s) * CirR1 + wCen, sin(s) * CirR1 + hCen);
- strokeWeight(4);
- line(wCen, hCen, cos(m) * CirR2 + wCen, sin(m) * CirR1 + hCen);
- strokeWeight(7);
- line(wCen, hCen, cos(h) * CirR3 + wCen, sin(h) * CirR1 + hCen);
- }
- }
1