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

variable not getting updated as expected in Java

I am learning Java and have encountered an unexpected problem: variable i is getting updated in mouse listener but updated value is not getting passed back to main program. But if I uncomment Thread.sleep(1) block everything is back to normal. Here…
pstsm2
  • 1
0
votes
1 answer

Get java class version from javac or JRE without a compiled class

Java class version can be obtained from a class binary using javap javap -verbose Test | grep 'minor\|major' minor version: 0 major version: 55 Is it possible to know in advance which class version a JDK will produce? java -version does not…
LMC
  • 10,453
  • 2
  • 27
  • 52
0
votes
1 answer

Ant/Javac not running annotation processors

I seem to be getting an odd compile error while building my main project. I have annotations in the source that is supposed to be generating class files, like NbBundle.Messages, and they are not being generated. The other projects that this one…
BrainStorm.exe
  • 1,565
  • 3
  • 23
  • 40
0
votes
1 answer

React Native CLI

Task :app:compileDebugJavaWithJavac Task :app:compileDebugJavaWithJavac FAILED w: Detected multiple Kotlin daemon sessions at build\kotlin\sessions Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You…
0
votes
0 answers

Is it possible to get a diagnostic's arguments using the JavaCompiler Interface?

I'm using the JavaCompiler Interface to compile source code files from within a Java program. I've successfully written code that captures the errors that exist in the source code file. I'm now trying to access the arguments of the diagnostic (for…
Janewby21
  • 1
  • 1
0
votes
1 answer

How does masking work with int/Integer in java?

Since bytes are signed in java, in order to obtain unsigned integer values we mask with 0xFF asper: byte signed = -1;// -—> 0b11111111 int unsigned = signed & 0xFF;// —-> 0b11111111 & 0b11111111 System.out.println(“unsigned: ”+unsigned);//prints…
linker
  • 821
  • 1
  • 8
  • 20
0
votes
1 answer

Does javac generate inaccurate line numbers compared to ecj (for this particular case)?

I use the following class which has this specificity in the equals() method that the return keyword and its expressions are split into several lines (return keyword is on its own line). package jd.core.test; import java.util.Locale; import…
Sybuser
  • 735
  • 10
  • 27
0
votes
0 answers

How to get java files of all folder into source folder

I'm trying to create my workspace without IDE and I want to put files and packages in the source folder but I don't know how to compile all java files. I searched and found it, but this command only get java files of source folder: javac -d bin/…
Guruunoob
  • 23
  • 1
  • 5
0
votes
2 answers

Why use source option in javac

I understand what source option does, but I don't understand why would someone want to use that. According to Oracle Docs: -source: Specifies the version of source code accepted. Source option restricts the features one can use, for example,…
charlie lin
  • 107
  • 1
  • 1
  • 5
0
votes
1 answer

javac reports "package does not exist" even though classpath is set

I have a file Test.java (stripped down for debugging): import com.github.tkutche1.jgrade.Grade; I try compiling it with this command line and get an error: # javac -cp lib/com/github/tkutche1/jgrade/Grade.class:. Test.java Test.java:1: error:…
Ellen Spertus
  • 6,576
  • 9
  • 50
  • 101
0
votes
0 answers

SPRING class file has wrong version 60.0, should be 55.0

so i get this error /Users/apple/Downloads/Seasalt-Konsumen/src/main/java/com/seasalt/repository/KonsumenRepository.java:4:47 java: cannot access org.springframework.data.jpa.repository.JpaRepository bad class file:…
0
votes
1 answer

Patch jdk.unsupported module in Java 17

For various reasons, I need to continue to use some sun.misc classes in Java 17, specifically the BASE64Decoder class. (The algorithm used by the class has some specific behavior that other base 64 decoders do not reproduce.) I'm planning to use the…
gbear605
  • 89
  • 1
  • 10
0
votes
1 answer

How to generate Native header files from java files in Android Studio

I am trying to learn Android Native programming , but i cannot use the Javac -h to generate header files from java source files . javac -h "destination path desired for header files" then i add Java source file BUT i keep getting errors saying :…
0
votes
2 answers

Compiling and executing a java program with a jar library package

I am trying to compile and execute a java program which uses JTidy. I've managed to compile the program using the following command: javac -classpath jtidy-r938.jar @sourcefile This seems to work just fine. However, when I try to run the program…
giroy
  • 2,203
  • 6
  • 27
  • 38