Is it possible to convert .class file to .jar file using c++ code?
(i.e can we write a code in c++ that when executed converts given .class file to .jar file)
If yes,how can i do that?
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.
A .jar file is just ZIP archive containing .class files and possibly a manifest file. (The most important part of the manifest file is the name of the class to run with
java -jar.) You can generate a .jar file quite easily in C++ from the .class file, by using a library which can generate ZIP archive files.If you don’t care about the size savings because of compression in the ZIP file, you can easily create an uncompressed ZIP file, even without using a library. The ZIP format is documented e.g. here: http://en.wikipedia.org/wiki/ZIP_%28file_format%29