I took an open source copy of a desktop tool, tinkered with it, ran it on Elipse and felt fine, but when IT came time to release the application, I was dumbstruck. I don’t know how to post it!

Ha ha, worthy of being Java white!

If it is Microsoft camp, directly compiled into exe. But in Java, if you want to compile to EXE, you need a third party tool, which Eclipse doesn’t have.

Moreover, to compile the EXE, you must first compile the source code into a JAR package. However, jar packages are divided into ordinary JAR packages and runnable JAR packages, which one to choose? And the source code is a bit big, and it references a lot of JARS itself.

This source code uses Ant and LVY, and I still don’t understand what they do. Ant lVY is supposed to help download dependencies like Nuget, but whether it also helps with distribution, like Ant Dist, is unclear.

I looked and looked on the Internet, but I had no clue. Then I asked my colleagues and got a point answer. Some people say that Java is not suitable for self-study, today’s letter yan.

Here’s how:

1. In Eclipse, right-click the project and choose Export. In the dialog box that is displayed, select Java and then Runnable JAR File

2,

1) Optionally compile all dependencies into the runnable package, but optionally 3) put them in the same directory as the runnable package. I don’t know what the second one means. I chose number three

And then the next step, ok. There will be a warning, ignore it.

At the end, the resulting file looks like this:

Kettle52_lib: dependency package kettle52.jar: distributed executable package UI: resource files, not generated, hand-copied spoon.bat: hand-written. The code just says:

java -jar kettle52.jar
Copy the code

You can also run kettle52.jar by double-clicking it directly. Getting a batch file is just a convenience.