Bug 495262 - [jar exporter] Add "Export as executable" option to the "Runnable JAR file" wizard
Summary: [jar exporter] Add "Export as executable" option to the "Runnable JAR file" w...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8.2   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-02 06:06 EDT by Andrey Loskutov CLA
Modified: 2016-06-02 06:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.