Problem Exporting App in 2.1.2

edited May 2014 in Using Processing

Hi,

I can't seem to correctly export any sketches as an app. For example, I used the following example sketch:

        void setup() {
          size(400, 400, P3D); 
          smooth(2);
        }

        void draw() {
          background(255, 0, 0);
          ellipse(mouseX, mouseY, 100, 100);  
        }

        void keyPressed() {  
          if (key == '1') smooth(1);
          else if (key == '2') smooth(2);
          else if (key == '3') smooth(4);
          else if (key == '4') smooth(8);
          else if (key == '5') smooth(16);
          else if (key == '6') smooth(32); 
        }

        //static public void main(String args[]) {
        //    PApplet.main("test2");
        //}

and export it. I tried to bundle it with and without Java. I also updated Java on my computer earlier in the week. When I double click the .bat file it opens a console window that immediately crashes. I went ahead and ran it via command line and got this error:

'java' is not recognized as an internal or external command, operable program or batch file.

I even tried to add that little bit of commented out code that was recommend in the tips and tricks of exporting wiki. (which the class name is the name of the sketch correct?)

Thanks for the help.

Tagged:

Answers

  • Do you get that error when you bundle it with Java, or when you don't?

    What is on your path?

  • edited May 2014

    I get the error with and without Java bundled.
    \Documents\Processing\test2\application.windows64\ start test2.bat

  • Having a similar error. I export it bundled with Java on 64-bit. It creates an application.windows64 folder with everything in it, including a .bat file. The .bat file works on my computer, but when I try it on any other computers it flashes another screen with some text on it very briefly and then quits before I can read it. Any insights?

  • Answer ✓

    In order to run a Java program, the OS gotta have at least a JRE properly installed.
    Since Processing 2.1.x is using Java 7 and the app was exported as 64-bit, make sure the JRE or JDK has that minimum specs!

  • When I ask what your path is, I mean your system path, not the location of your file. Like GoToLoop said, Java needs to be on your path for it to work.

    (Although, shouldn't it work when you bundle the JRE with it?)

  • Looks like the installed default Java was 32 bit. I downloaded the previous version of Processing that allows you to export for multiple OS's to test that the 32 bit was working and only the 64 was not. Now I have the 32 and 64 bit JRE and my exported applications are working fine.

  • I ran the program from the command line (64bit Windows) on the computers it's not working on, and the error given is:

    'java' not recognized as an internal or external command, operable program, or batch file.

    Is this a matter of downloading the JDK on the computer?

  • On some computers, I get the error message: windows can not find javaw.exe

  • Answer ✓

    Install JRE at minimum! JDK is even better! :bz

Sign In or Register to comment.