How to create a single .exe file?

Hi,
I already know how to export an app, and it would be great if i could create a single .exe file to open it.
So i would like to know if it’s possible and how to do it ! :slight_smile:

Thanks in advance ! :+1:

This is not exactly trivial, and there isn’t a quick one-button way to do it from Processing.

Basically, Processing gives you a Java application that comes in the form of several .jar files. Now you need to take these .jar files and create an executable file from them.

This goes outside the bounds of Processing and into more advanced lands, which is why there isn’t a quick way to do it from Processing.

If I were you, I’d google something like “java deploy as executable” for a ton of results. I’d also check out Launch4J and JWrapper, which are tools that help with this.

1 Like

Launch4J : i already tried and don’t know how to do, even with tutorials

/---------------------------------------------------------------------------------------------------/

JWrapper : we need a license to use it…

/---------------------------------------------------------------------------------------------------/

JSmooth : i tried to download it but it doesn’t works
Capture

/---------------------------------------------------------------------------------------------------/

JarToExe : how am i suposed to select the main class ?

/---------------------------------------------------------------------------------------------------/

Advanced Installer : doesn’t works well and it’s a trial version only

/---------------------------------------------------------------------------------------------------/

I also tried to create an executable jar file with eclipse but i have a problem…
Capture

/---------------------------------------------------------------------------------------------------/

I tried during more than 1 hour…

1 Like

Like I said, this is not exactly trivial.

The best advice I can give you is to start smaller. Create a simple sketch that just shows a hard-coded circle or something, and try to export that as an executable. Work your way up from there.

Good luck. Please post back with what you find, as I’m sure other people have the same question.

1 Like

okay, thanks for your help :slight_smile:

This next is not a solution to your problem but hopefully one step closer to your endeavor.

Related to this question, you need to become familiar with the export operation in Processing. Your pde file is converted to a java file. If you export the file, you will find a folder than contains the executable of your pde, as you have describe in your first post. In that same folder, you can find a source folder which contains your pde file converted to java. By the way, this folder also has a copy of your pde file. Now, it is inside this java file that you find your main. If you have multiple pde files, then Processing will merge them together under the main pde (that file that has the same name as the root folder of the sketch). For the name of the class, it is the name of your pde file. As a matter of fact, if you open this java file that I am talking about, it will become clear what class contains the main function.

By the way, what OS are you working on?

Good luck!

Kf

i tried a simple example in eclipse

package packageName;

import java.awt.FlowLayout;
import javax.swing.*;
	public class main {
	    public static void className(String s[]) {
               JFrame frame = new JFrame("JFrame Example");
	        JPanel panel = new JPanel();
	        panel.setLayout(new FlowLayout());
	        JLabel label = new JLabel("This is a label!");
	        JButton button = new JButton();
	        button.setText("Press me");
	        panel.add(label);
	        panel.add(button);
	        frame.add(panel);
	        frame.setSize(300, 300);
	        frame.setLocationRelativeTo(null);
	        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        frame.setVisible(true);
	    }
	}

then
file > export > Java > Runnable JAR File > next > select launch configuration > select export destination > finish
i now have a runnable jar file
PNG

I already know about the java file and all, that’s why I tried to do something with eclipse but it still doesn’t work…

And I use windows ^^