Bug 495262

Summary: [jar exporter] Add "Export as executable" option to the "Runnable JAR file" wizard
Product: [Eclipse Project] JDT Reporter: Andrey Loskutov <loskutov>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 3.8.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Andrey Loskutov CLA 2016-06-02 06:06:47 EDT
On Linux (end eventually on Windows, no idea for Mac), there is a way to package "java -jar blup.jar" command along with the jar itself into a single executable file, see http://superuser.com/questions/912955/how-to-make-a-java-jar-file-to-be-a-single-file-executable

#######################
1- Create a stub:

MYSELF=`which "$0" 2>/dev/null`
[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"
exec java -jar $MYSELF "$@"
exit $?

2- Concatenate the stub and the jar into a new executable:

cat stub.sh Main.jar > main.sh

3- Make the new file executable:

chmod +x main.sh
#######################

This is a nice thing and we should add such an option and functionality to the FatJarPackageWizard.