How can I embed binary file (executable, to be exact) in Java application? Is there a way to read a file during compile time, or do I have to copy hexadecimal dump into source code of the application ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Jar files are zip files with extra meta-data. You can easily embed an exe-file in your jarfile directly.
You cannot easily have Windows execute the EXE-file inside your zip-file, but you can read it from your classpath resource and write it to a temporary file with an “.exe”-suffix, and then execute that.