I took a copy of the desktop tool open source code, modify the change, on the Elipse execution. Feel good. But by the announcement of the application, it was dumbfounded.
I don't even know how to publish!
Oh, it is Java small white.
The assumption is that the Microsoft camp, directly compiled into an EXE.
But Java here, suppose to compile to EXE, also need a third-party tool, Eclipse is not.
Moreover, to compile EXE, the premise is to first compile the source code into a jar package.
But the jar package is divided into ordinary jar and executable jar package, which one to choose? And this source is a bit large, and it itself refers to a lot of jar packages.
This source uses Ant and Lvy, and I can't figure out what they're doing right now. Ant,lvy should be like NuGet, to help download the dependency package, but whether there is a role to help publish, such as Ant dist or something, it is unclear.
Search on the Internet, no clue, and then asked colleagues, only to know a point answer.
Some people say that Java is not suitable for self-study. Today's letter is a Yan.
The method is Jiangzi:
1, under Eclipse. Right click on the project, select Export, Pop Up the dialog, select Java, then select runnable JAR file
2.
1) be able to choose to compile all the dependent packages into the executable package, but also to choose 3) with the executable package placed in the same folder. The 2nd one doesn't know what it means. I picked the 3rd one.
And then next, you can. Then there will be a warning, whatever it is.
To the end, the resulting file is this:
Kettle52_lib: Dependent Packages
Kettle52.jar: Advertised Executable package
UI: is some resource file. are not generated. I copied it manually.
Spoon.bat: I wrote it manually. The inside code is just this:
java -jar kettle52.jar
Of course, directly double-click Kettle52.jar is also able to execute. It is only convenient to make a batch file.
Publish Java Desktop programs