Category "javac"

Java program runs yet compilation fails

I wrote a Java program whose filename was (intentionally) different from the class I wrote inside the file. The javac command failed as expected on both CMD and

Where is 'javac' in java-17-openjdk-amd64?

Win10 WSL 2 over an Ubuntu layer Ubuntu: lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release:

JDK 11.0.2 compilation fails with javac NPE on anonymous parameterized class type inference

Code (spring-web 5.1.2) public static void main(String[] args) { RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders

Why does it matter if I use a method reference or a lambda here?

When I try to compile this code import java.util.Optional; public class GenericTest { public static void main(String[] args) { Optional.empty().m

Compile a JDK 8 project + a JDK 9 "module-info.java" in Gradle

I'm working on a Java library targeting JDK 8, and I'm building it in Gradle 5 using OpenJDK 11. In order to target JDK 8, I'm javac's --release option. Howeve

How to write code in Java 11, but target Java 8 and above?

I am working on a small library and for obvious reasons I would like to write code using all the Java 11 features (except modules I guess for now), but I would