Can I include the rt.jar in my executable jar file and double click to run it without installing java on the machine first ? I hope it to use that rt.jar in my jar to start it self, possible ? If not, any other way ?
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.
No, you need a java virtual machine.
rt.jaris also interpreted by the virtual machine and is just the java class library.If you’re looking to turn the code native you might consider gcj which can convert java code to machine code and wrap it up in an exe as per gcc. However, I’m not sure what version of java gcj supports – I’ve read somewhere it isn’t very recent.
It looks like Launch4j can include a bundled JRE, so you might consider this.