Hi Java Fans I need to convert Java class files to Exe. I am sure Javaranchers would help me on this. I would also like to have some idea about Protecting a java application, so that it wont be copied to a third party system Thanks
first u have to make manifest file for ur main class like , u open any new text file and write this command Main-Class: urmainclass (without class extension) then save this one with an extension like txt or mf, but after writting this line u put enter then save.(eg my.txt) and now go to ur dir where ur class file are there in the command promt & write the code like jar cmf my.txt *.class after this u will get a executable jar file. now if u double click on this file icon it will execute. ejoy
Wait a minute. I have never seen a jar file that would execute an application on a double click. I think this guy is dreaming. Making a java exe is not nearly that easy. You can create a ".bat" file (create a text file, type in the command line command to run your java app, save the file with a .bat exentsion, now you can double click and get some action!) There is also a javaToExe tool out there that probably uses a C++ Wrapper or something like that. Additionally, you can use JNI and C++ to create a C++ executable that will start your program. Do a search on this site for java exe and you'll get a ton of informative threads.
Hi David I have tried JavaToExe, but it executes sucessfully in Windows NT I am not so lucky with Windows 95. Also i need the class file to be converted to exe only, since i have a hardware lock which protects the application using a command exeprot. the hardware vendor is not supporting NT so i have to do it with Win 95. I have also tried JNI, created a DLL then called the Java funtion in theat DLL, still the result not what i had expected. Can i read an .obj file in Java?? I shall try downloading Microsoft SDK for Java , there is a tool jexegen wich converts .class to .exe. Bye
David, the fact that you have not seen a jar execute on a double click does not mean it can't be done. ALl you have to do is create an executable jar file like dkumar sharma describes and then assoicate "*.jar" extension with a java command.
without any configuration but having the jre installed.... i heard of somebody knowing somebody having a native code compiler, creating system specific code out of class/java files. using a obfuscator wont prevent somebody of decompiling your files but it will make them harder to understand. another way would be to encrypt your class files and write your own class loader. then user has to supply password to run app (this does not prevent somebody from passing the app with password.......and from decompiling with the password.....but it's again a little harder to do) karl
Hi Guys, I found one tool to create setup file. this is excellent tool which will create exe file with JVM or without JVM etc., and it has facility of multiple language too. Name of the tool is JExpress, and you will have 30 days evaluation copy also. site name is www.denova.com if you are interested you can make use of this site. wish you a good luck. venkat