We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I am trying to make my code work on any computer by exporting it as application. I tried exporting it and I also selected Embed and when it is done it gives me a file includes some files and a .bat file with the name of my sketch and when I open it it just blinks a cmd screen and do nothing...
I tried a sketch from examples and it was the same..
What can I do please help me I have to finish this asap
Thank You
Answers
Processing is compiled as a Java program! Make sure you got JRE correctly installed at the least!
Most ideal is having a unique ".jar" generated file. The old Processing v1.5.1 was able to do just that w/ CTRL+E!
For current Processing 2.x.x series, take a look at SvgExe tool:
http://forum.processing.org/two/discussion/3903/svgexe-create-standalone-runnable-jars-for-every-system
I have seen this amazing program and it works perfectly! But it did not work on my code because my code includes a stream video input! also my final code includes controlling servos via motion detection and via mouse.
so I have no idea if this would work! will it?
did you try to start the bat-file from a console-window? that way you could check if there is an error message and what it says.
What do you mean by console-window? how can I run my code through console-window? The code is running perfectly in processing
PS: I am using windows 7 pro 64bit and 2.1 processing
There are a lot of stuff in processing that I do not know yet!
Thank You..
these are all the files in the lib folder..after exporting the code above
press start, type cmd, you will see the application cmd.exe. Run that and navigate to the directory with your app (google "cmd navigate to directory"). Then run the bat file from cmd.
According to this FAQ http://wiki.processing.org/w/Troubleshooting#Security_Issues you will see this statement about exported applications: "Applets are also not allowed to do things like capture video or audio."
@spacewalker - Applet (Java applets running in the browser) support has been dropped in 2.0. This advice, although potentially useful, doesn't apply to exported applications.
@calsign - thanks for pointing that out. New user here and just ran across what I thought sounded similar to something I had just read. Thanks again. :)
I have tried to open the .bat file from the cmd console-window and it did not work either.. :(
I need to finish this so I can submit my graduation project :(
I have seen other project that used stream video in their project GUI so I think that this can work but I have no idea how..
I would really appreciate it if you give me more options thank you
SvgExe should work regardless of your video... assuming that Processing is exporting your native libraries and whatnot correctly, which it doesn't seem to be.
What error do you get when you run the .bat file from the console? For that matter, what does your .bat look like? Is it setting your native library location correctly?
There is no error when I open the .bat file it just blinks a cmd screen for less than a second and nothing happens after that.
I think the problem is selecting the class's, the external files and the natives all I did at the moment is just selecting the processing .jar and my sketch name .jar
I do not know what are the external files and the natives. and this is the problem I guess.
Is there any thing explains how I can know which files are external and natives ?
We're asking you to open it from the command line, not by double-clicking it. That will show you the error you're getting instead of just flashing it on the screen.
What is the text of the .bat file? You should be able to open it with a basic text editor.
What do you mean you selected the processing jar and your sketch's jar? Selected them where? Which Processing jar?
You might want to look at the documentation for whatever library you're using that requires those native files.
I did open it from CMD (isn't it what you mean? command line) I opened cmd and navigated to the .bat file and opened it and nothing happen.
The text is random letters from many languages!
I selected the .jar files in the "SvgExe" tool, as I learned from reading it I have to download a processing.jar file from their website and select it with my sketch.jar file when I want to export application.
The photo explains what I said earlier "I think the problem is selecting the class's, the external files and the natives all I did at the moment is just selecting the processing .jar and my sketch name .jar"
I know I can open .bat files with a basic text editor to see what it's doing. I use JEdit as my basic text editor. You need to determine whether Processing is not setting the native library path correctly, or if some of the native libraries are not being exported correctly. If it's the latter, then you won't be able to run this program until you fix that.
I suggest creating a basic Processing sketch that doesn't use any libraries or native files. Export that and look at the jar files it generates. You should see the SketchName.jar, and then a bunch of other files. These are the files included in ProcessingLibrary.jar, along with the same files for the other systems.
Any jar file that is in the output of your more advanced Processing sketch but not in the output of the basic Processing sketch needs to be included in the "jars" section of SvgExe.
You also need to add all of your native files to SvgExe. You have a bunch of them.
Actually, it looks like you only have .dll files anyway, so you won't be able to run on multiple systems fro
The text editor did not do much help as it was just random letters again (I used JEdit this time).
I did export a basic sketch to see what .jar files it has in common with my sketch and I found 2 extra files I did not add them before so I added them and still did not work while the basic sketch worked just fine!.
Now I think the problem here is that I do not know which are the native file and which are not! how can I say which one which ?
PS: My code is up in the 3rd comment you can use it and see if you may
Anything that ends in a .dll is a native file, specific to Windows.
added the .dll files to native and still did not work :( I wish if there was another way as this way seems to be not working with my code
Step 1 is to get the .bat working. I can also open the .bat on my machine with regular ol' notepad. You need to open the .bat to see if it's setting the native library path.
Some thing happened! there is no more .bat file! its now .exe as in the photo. I have updated processing from 2.1.1 to 2.1.2. also the exported file is now named "application.windows32" instead of "application.windows64"!
Yes. For some reason, Processing 64 exports with a .bat to run the sketch while the Processing 32 exports with a .exe.
You can reuse the previous .bat file you go to run the export in 32-bit mode, though. I did that with previous 2.0 versions which had issues with exporting, as a workaround.
I can not use the previous .bat file as I have been deleting them when they were not working, and now I can't make them any more! I only can make the .exe file..
what else should I do with this .exe file, PhiLho?