Top "Java-compiler-api" questions

A Java API for the Java compiler, available as javax.

android studio with Java compiler error: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'

When I clean the android project in android studio, the error happen, I have backed to previous commit or different …

java android android-studio java-compiler-api
Compile code fully in memory with javax.tools.JavaCompiler

I'm using the JavaCompiler from the javax.tools package (JDK 1.7) to compile some stuff on the fly, like this: compiler.…

java compilation javac java-compiler-api
How to set classpath when I use javax.tools.JavaCompiler compile the source?

I use the class javax.tools.JavaCompiler (jdk6) to compile a source file, but the source file depends on some …

java jdk1.6 java-compiler-api jsr199
Null Pointer Exception while using Java Compiler API

MyClass.java: package test; public class MyClass { public void myMethod(){ System.out.println("My Method Called"); } } Listing for SimpleCompileTest.java …

java nullpointerexception java-compiler-api
Why does Java not show an error for double semicolon at the end of a statement?

I accidentally wrote a java statement with two semicolons at the end. The java compiler does not show any error …

java java-compiler-api
Is it possible to programmatically compile java source code in memory only?

I have found many references explaining how to programmatically compile a Java class using the JavaCompiler class: JavaCompiler compiler = ToolProvider.…

java code-generation java-compiler-api
Annotation Processor - How to get the Class it is processing

I am trying to write a custom Anntoation processor. The annotation processor will process each class file at compile time …

java annotations annotation-processing java-compiler-api
String too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'

Java compiler error: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'. I want to note, …

java android gradle kotlin java-compiler-api
Can I add a method to a class from a compile time annotation?

If I create a custom annotation (example: @SaveFuncName("saveMe") will add a method called saveMe() with some code my processor …

java annotations java-compiler-api
Java annotation processing with source code manipulation

I have been looking for a solution for below requirement - Source files are written with Custom Annotation on a …

java annotations apt java-compiler-api