I just created a simple Java application that will generate entity classes for our database. These are java classes that I will save on my local disk. So far, everything is working fine.
Now I want to generate a JAR file from these Java classes in the main application. I know that I can manipulate jar files, and I also read about adding classes to the jar file at runtime.
But in my case, I have no classes in my build path. I need to create class files from newly created java files and put them in a jar file.
Is this possible in my java application?
The reason I do this is because our database will be expanded by many people all the time, and I donβt want to add these fields to my entity manually. Therefore, I wanted to create an application that scans systables from our database and generates java entity files from this information. But now I need to compile these java files in class files after they are created and add them to my last jar file.
Thanks for any help and / or information about this issue.
Many greetings, Hauke
source share