Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
472 views

Settings I'm using JDK 22: openjdk version "22" 2024-03-19 OpenJDK Runtime Environment (build 22+36-2370) OpenJDK 64-Bit Server VM (build 22+36-2370, mixed mode, sharing) I'm also using ...
Yann-Gaël Guéhéneuc's user avatar
0 votes
0 answers
178 views

Top of the morning/noon/evening! I have a multi project setup in which I use an annotation processor. This annotation processor is supposed to pickup Plugin instances (a custom interface) during the ...
Thorben Kuck's user avatar
  • 1,142
0 votes
0 answers
99 views

I want to modify some java classes bytecode during/after compilation phase, but before packaging, in order to use custom invokedynamic bootstrap methods. In order to do so, I have written a Java ...
Mikhas's user avatar
  • 882
0 votes
1 answer
25 views

I am attempting to write a Java project, which will compile any Java project and export a *.jar file. The program expects 3 runtime arguments, which I am specifying as: C:\dev\Kronos\Kronos vendor src\...
Temps's user avatar
  • 21
0 votes
0 answers
647 views

I'm developing a compiler plugin for Javac. My codebase uses preview features, so I need to run using the flag --enable-preview. I can compile my code perfectly using maven, but when I try to do the ...
Auties01's user avatar
-1 votes
1 answer
139 views

I use Java compiler class inside my Spring Boot application as follows: String classStr = "\n" + "import java.util.List;\n" + "import java.util.Map;\n" + ...
Nilanka Manoj's user avatar
0 votes
2 answers
503 views

How to get parent tree node from JCTree (com.sun.tools.javac.tree.JCTree) in Java? For example: public class MyTreeTranslator extends TreeTranslator { @Override public void visitMethodDef(...
Guo's user avatar
  • 1,823
0 votes
0 answers
216 views

I'm using JavaCompiler API in Spring boot application. But currently I'm facing with an issue on getting spring boot runnable jar file classpath using System.getProperty("java.class.path") ...
Daniyar's user avatar
  • 886
1 vote
0 answers
117 views

How do you create a JavaCompiler instance not on your system? More specifically, I would like to be able to create a JavaCompiler instance from a version number. The only techniques I have seen for ...
Lindstorm's user avatar
  • 909
3 votes
2 answers
1k views

I want to load a Java version specific JavaCompiler. This is how I take compiler instance currently: JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); My aim is to compile a "user Java ...
niranjan_harpale's user avatar
2 votes
0 answers
321 views

I have developed an application that generates Java source at runtime from an external source. The generated source code implements an interface residing in say org.foo and also calls other classes ...
eddy's user avatar
  • 91
0 votes
1 answer
122 views

Adapting this the following code takes a class and function name, a string of Java code, compiles the code and runs the function. public class Compile { static void compileAndRun(final String ...
user avatar
1 vote
1 answer
49 views

Just verified that javac compiles every reference or import that it sees, such as JavaDoc @link references. Can this be turned off with an argument? And/or, can a less eager compile be implemented ...
Jonas N's user avatar
  • 1,787
1 vote
0 answers
116 views

I'm trying to generate some repositories at runtime for spring data jpa with OpenHFT to reduce boilerplate code. The problem is, when running with IDEA it goes just fine, however if i run it in ...
gtBacteria's user avatar
-2 votes
1 answer
204 views

Can any one help me in figuring out what compilers and interpreters are? And what their difference is ? Appreciate it if explained for Java beginner as I am one.
Amanuel Getachew's user avatar
2 votes
1 answer
2k views

In a Spring Boot app I'm doing the following at runtime: Generating a Java class Compiling it Accessing some static fields of the compiled class using reflection. I've based my code on this post and ...
forhas's user avatar
  • 12k
1 vote
0 answers
784 views

We have a situation where we are using some library and we would like to customize the logic of a tiny private method used in the library. Unfortunately, the library isn't well written to be extended. ...
Oleksandr's user avatar
  • 3,794
0 votes
1 answer
159 views

I am trying to write an extended Java Compiler that gives all the errors and warnings from javac plus some errors for custom unsupported java features. Since this is going to run on a server, i would ...
dj_rydu's user avatar
  • 128
0 votes
0 answers
1k views

I have a task to compile java source file from source code. So I used JavaCompiler API. My java class annotated with Lombok annotation @Data. But when I compiled class exceptions are thrown. Name....
sadia's user avatar
  • 325
62 votes
25 answers
109k views

When I clean the android project in android studio, the error happens. I have backed to previous commit or different branch, which worked fine couple days ago, but has this error now. I have checked ...
Xianwei's user avatar
  • 2,561
0 votes
1 answer
464 views

I already have a program that uses JavaCompiler api for compiling Java code at runtime. Can I use the same compiler for scala code? If not, what is the best way to compile scala code in a Java program?...
user9024779's user avatar
2 votes
2 answers
311 views

//Following is Hello.java file. public class Hello{ public static void main(String... s){ System.out.println("hello world"); } } I'm trying to compile the above class using Java ...
Abhishek Mishra's user avatar
1 vote
2 answers
197 views

I am working on a school project where I need to generate Java code that adheres to the Java Language Specs. So far I have been able to generate the Java code randomly which has valid syntax that ...
adarsh hegde's user avatar
  • 1,383
2 votes
0 answers
268 views

I'm trying to use JavaCompiler to compile a Java source at runtime: $ cat src/main/java/App.java import java.util.LinkedList; import javax.tools.JavaCompiler; import javax.tools.JavaFileObject; ...
Idan Arye's user avatar
  • 12.7k
2 votes
1 answer
2k views

I am learing Java Compiler API recently and I write some code that can compile one simple java source code file into a class file, but it can't compile a source code file which refer another class in ...
kk17's user avatar
  • 631

1
2 3 4 5