I’m currently trying to fiddle with images, specifically convert images from JPEG, WEBP, and BMP forms to PNG forms and my method uses the javax.imageio.ImageIO class. When I tried importing it, Eclipse yelled that the package that the type was not accessible. I thought that was weird and went digging through StackOverflow on my own and found multiple answers saying
Tag: java-16
How do I create a jar file via the command line?
Lets say I have these .java files: MainClass.java 2ndClass.java BarClass.java FooClass.java Then I turn them into .class files: MainClass.class 2ndClass.class BarClass.class FooClass.class How would I make it a jar file, and have MainClass.class be the first to be loaded? Answer Observing what Elliott said about class files, you can create (in recent versions of jar) the manifest implicitly with That
IOException in Java 8 when reading PKCS12 keystore created with keytool from OpenJDK16
TL;DR keytool from OpenJDK16 creates PKCS12 keystore files that cannot be read from Java 8, 9, 10 and 11. Is this a bug? How to create a PKCS12 keystore that works with Java 8? Context I build a Maven project which produces an executable JAR file that must run on any JRE from version 8 to version 16. That JAR
What annotation targets are applicable to Java records?
I have an annotation used for methods or fields defined like this: I wanted to prevent users from using this on a record since it wouldn’t make sense for this annotation to be used in that context. It seems doing this should not compile since I don’t specify ElementType.PARAMETER as a valid @Target. The following compiles fine though: But this
How to use @ConfigurationProperties with Records?
Java 16 introduced Records, which help to reduce boilerplate code when writing classes that carry immutable data. When I try to use a Record as @ConfigurationProperties bean as follows I get the following error message: How can I use Records as @ConfigurationProperties? Answer Answering my own question. The above error raises from Spring Boot not being able to construct the
IntelliJ JDK 16 Early Access – Any Success? tools.jar
Has anyone had any success using JDK 16 (https://jdk.java.net/16/) early access build with IntelliJ? I am able to use JDK 15 early access builds, but when I try JDK 16 I get an error message: Error: …