issues running exported program with error "Could not find the main class. Program will exit".

edited December 2013 in Using Processing

Hi, I am trying to run an executable that is the result of using the export feature of processing. Everything seems to go well but when i try to run the executable i get the error "Could not find the main class. Program will exit". I have tried setting the CLASSPATH variable to no avail. I see this question has been asked on the forum before but there doesnt seem to be a answer.

Processing version = 2.03 OS = windows 7 32 bit

Any help is much appreciated.

Cheers.

Answers

  • Do you have the problem for all sketches (try with a simple one) or only a specific one?

  • Also, could you put together the smallest example program that exhibits this behavior?

  • Hi, And thanks for the replies. This is what i have found so far; I converted two simple examples using the export feature - for both examples two subdirectories were created applications.windows32 and applications.windows64. The executable in applications.windows32 (.exe file) does not work and comes up the error "Could not find the main class. Program will exit" in the Java machine launcher window. The executable in applications.windows64 (.bat file) does work. For my application the applications.windows64 is not created and a window pops up with the following information "the applicaton.windows64 will not be created because there is no 64 bit version of serial available for windows". Firstly i assume from this that my system is in fact 64 bit not 32 but shouldnt the executable in the application.windows32 still work.

    Any help is much appreciated.

    Cheers.

  • Export of 32-bit application in Windows is broken in Processing 2.0, at least for the .exe. But you can copy the .bat generated in the windows64 folder to run the windows32 application! I shown this in another thread about this problem. (In the same forum category.)

  • Hi And thanks for the reply. The problem is i dont have a windows64 folder: For my application the applications.windows64 is not created and a window pops up with the following information "the applicaton.windows64 will not be created because there is no 64 bit version of serial available for windows". So i only have the win32 folder.

    Is there another way around this issue. When is 32-but application export likely to be fixed.

    Thanks for your help.

    Cheers.

  • Hi, And thanks for the reply.

    I have made progress making use of the link you supplied however i am now getting a serial error that i dont quite understand.

    Contents of bat file:

    @echo off
     java -Djava.ext.dirs=lib -Djava.library.path=lib MultiSerEg2
    

    Error out put from console:

    java.lang.UnsatisfiedLinkError: C:\Users\yatesr\Documents\Processing\MultiSerEg2
    \application.windows32\lib\rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64
    -bit platform thrown while loading gnu.io.RXTXCommDriver
    java.lang.UnsatisfiedLinkError: C:\Users\yatesr\Documents\Processing\MultiSerEg2
    \application.windows32\lib\rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64
    -bit platform
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(Unknown Source)
            at java.lang.ClassLoader.loadLibrary(Unknown Source)
            at java.lang.Runtime.loadLibrary0(Unknown Source)
            at java.lang.System.loadLibrary(Unknown Source)
            at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
            at processing.serial.Serial.list(Unknown Source)
            at MultiSerEg2.setup(MultiSerEg2.java:188)
            at processing.core.PApplet.handleDraw(PApplet.java:2280)
            at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
    
            at processing.core.PApplet.run(PApplet.java:2176)
            at java.lang.Thread.run(Unknown Source)
    Exception in thread "Animation Thread" java.lang.RuntimeException: Error inside
    Serial.ports()
            at processing.serial.Serial.errorMessage(Unknown Source)
            at processing.serial.Serial.list(Unknown Source)
            at MultiSerEg2.setup(MultiSerEg2.java:188)
            at processing.core.PApplet.handleDraw(PApplet.java:2280)
            at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
    
            at processing.core.PApplet.run(PApplet.java:2176)
            at java.lang.Thread.run(Unknown Source)
    

    All of your help so far is much appreciated.

    Cheers.

  • When you type

    java -version
    

    on the command line, what do you get?

    If it is a 64-bit version of Java, you need to install a 32-bit version.

Sign In or Register to comment.