I would like to know if there is a JavaCompiler library for me to provide within my jar file, so users can run my program, which uses a JavaCompiler, also with a JRE?
Because a JavaCompiler is only implemented in a JDK and therefore a user has to use a JDK for their runtime environment.
Common users have a JRE installed.
Take a look at Apache Commons JCI. It should provide what you want.