Skip to content

Compilation of a JSR330 class fails with RuntimeException #28

Discussion options

You must be logged in to vote

Weirdly I have the classes in my classpath (maven dependencies) and I could generate the source class without issue.
But the compilation fails.
To solve the error, I had to add the classpaths of the project wherein I want to store the compiled class. like this:

var compilationTask = javaMemoryCompiler.compile(
                JavaMemoryCompiler.Compilation.Config.forUnitSourceGenerator(
                                unitSG
                        )
                        .addClassPaths(runtimeClasspathElements)
                        .storeCompiledClassesTo(
                                sourcePath.toAbsolutePath().toString()
                        )
        );
        compilationT…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@HomeOfTheWizard
Comment options

@HomeOfTheWizard
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by HomeOfTheWizard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants