Questions tagged [javac]

javac is the primary Java compiler, included in the Java Development Kit (JDK) from Sun Microsystems (now Oracle), and also in versions from other vendors.

javac is the primary Java compiler, included in the Java Development Kit (JDK) from Sun Microsystems (now Oracle), and also in versions from other vendors.

The compiler accepts source code conforming to the Java language specification (JLS) and produces bytecode conforming to the Java Virtual Machine Specification (JVMS). javac is itself written in Java. The compiler can also be invoked programmatically.

2467 questions
0
votes
0 answers

Could not find or load main class "Name of class" in VSCode

When I use the java/javac command on cmd as in javac Theory/HelloWorld.java java Theory.HelloWorld it works just fine, yet when I do that on the VSCode terminal it doesn't work at all and says "Error: Could not find or load main class…
BODDAH
  • 1
0
votes
0 answers

Moving compilation from JDK17 to AspectJ Compiler (ajc)

I have a project I am working on which is currently being compiled using JDK 17. I am working on adding advices using AspectJ and wants to use the compile time weaving for it. I am trying to compile the code - 'Existing Source Code + AspectJ…
user762421
  • 503
  • 1
  • 12
  • 24
0
votes
0 answers

Is the annotationType of an AnnotationMirror associated with the wrong module by javac?

Suppose I have the following in some unit test code somewhere, patched into a module named com.foo.main (name doesn't matter, only that this test code is running as part of a module): @org.junit.jupiter.api.Test // name probably doesn't matter final…
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
0
votes
1 answer

Unchecked warnings of java compiler does not occur in some cases

Consider this very simple generic class: class GenericTest { T t; GenericTest(T t) { this.t = t; } } I created multiple objects of this class, one of them is raw type: class App { public static void main(String[] args) { …
Mehdi Rahimi
  • 1,453
  • 5
  • 20
  • 31
0
votes
0 answers

Add constant field to interface during compilation

I have an interface like this @MyAnnotation public interface Foo { public String methodA(); public String methodB(); } I'd like, at compilation time, to add some constant filed to this interface without modifying the source…
lelmarir
  • 593
  • 2
  • 7
  • 24
0
votes
0 answers

I have try to build ionic app with sdk 31 but i got error below error. Execution failed for task ':app:compileDebugJavaWithJavac'

enter image description here I have try to build ionic app with sdk 31 but i got error below errer. FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. Compilation failed; see the…
0
votes
0 answers

Sublimetext 3 doesn't show german umlauts äöüß

Sublimetext doesn't show me the German umlauts öäüß in Java when I build the program. In other program languages they work. example I've looked up just about every tutorial or post, but I can't get it to work. Everything I know is in UTF-8. It works…
0
votes
0 answers

Compile entire java project through cmd

I made a project (Chess GUI game) that includes a few directories, in java. Here is the project tree: ├───images │ black_bishop.png │ black_king.png │ black_knight.png │ black_pawn.png │ black_queen.png │ …
nortain32
  • 69
  • 1
  • 7
0
votes
0 answers

How can I get java compile encoding option value that gradle is using?

I want to know the default value that gradle/javac is using for -encoding option. I tried below - tasks.withType(JavaCompile) { println 'Compiler args: ' + options.compilerArgs println 'encoding args: ' + options.encoding } and the…
CodeBot
  • 33
  • 5
0
votes
0 answers

pass javac -processorpath or gradle annotationProcessorPath via environment variable or system property

Modern Gradle does not discover annotation processors by default. The 3rd-party low-code solution we use calls Gradle internally and to compile our java classes and we want it to discover the annotation processor in a jar with known…
basin
  • 3,949
  • 2
  • 27
  • 63
0
votes
0 answers

How can I compile Java code against a JAR in a specific location using javac?

I am trying to compile a .class from my .java source code, using a JAR I have downloaded locally to a download directory in my project directory tree. I am using this JAR. The .jar file exists where I expect it to be: $ file…
Shane Bishop
  • 3,905
  • 4
  • 17
  • 47
0
votes
0 answers

In the Jenkins I am trying to compile and run my Java program

In the Jenkins 'Add build step' -> 'Execute Windows batch command' I am trying to compile and run my Java program. cd D:\eclipse-workspace-ghj2\ExecJava_CustomDirectory_1\src javac pkg/Manager_1.java java pkg/Manager_1 But in command prompt it…
TestSQA
  • 26
  • 3
0
votes
1 answer

How to Run a java compiled file from a package in the Windows Command Prompt?

How to Run a java compiled file from a package in the Windows Command Prompt? D:\eclipse-workspace-ghj2\ExecJava\src\pkg>javac Manager_1.java D:\eclipse-workspace-ghj2\ExecJava\src\pkg>java pkg.Manager_1 Error: Could not find or load main class…
user7208250
0
votes
0 answers

Generate Javadoc and sources for the library

I have an Interface and a Class that implements it in a Project (say Project1): public interface MainInterface { /** * some description goes here * @param foo * @param bar * @param ufo */ void someAbstractMethod(int…
0
votes
1 answer

Problem running AspectJ Load-Time-Weaving with java command

I am trying to run and test the aspectJ load time weaving. It compiled successfully. javac -cp "lib/*" -d classes src/*.java While running the program, the output is only Hello. Sadly, aspect did not run. java…