I need to create runnable .jar file programmatically from a string. My decision is to create a .class file from string and add it to the .jar using JarOutputStream.
- What API must I use to create the
.classfile? - Are there any other solutions to create a
.jarfrom the source code?
In order to do that, you can use the Java Compiler API.
There is this excellent tutorial that can walk you through.