I created a tiny c++ program that launches an appletviewer which presents my Java Applet. I have compiled my main.cpp file to a main.o file and now I would like to create a single .exe file by linking the main.o file with my applet.class file. How could I do this? (fyi I am using the MinGW command-line compiler). Is there a way to turn a .class file and an .html/.htm file into a .o file or another object file?
Asked
Active
Viewed 130 times
0
-
You can't do that in a normal way, because class-files are not understood by the c++-linker. The only way I could imagine would be to store the class-file as a resource, and when the program starts, it copies that resource to /tmp, and then calls java with that copy in /tmp. Weird. But maybe somebody has another idea... – pbhd Dec 14 '12 at 19:32
1 Answers
1
This is what jar files are for. Deployment of applications in Java should take the form of jar files. If you're writing a native code wrapper to start up a virtual machine then you are doing it wrong. On the plus side, it's usually quite simple to refactor applets into applications. Just inherit from JFrame instead of whatever applet class you are using, and then compile and export into an executable jar with a Main-Class attribute in the manifest.

Max DeLiso
- 1,213
- 11
- 23