Skip to content

Tag: java

Unable to make field final transient java.lang.Class java.util.EnumSet.elementType accessible: module java.base does not “opens java.util” to unnamed

I get this error when I run this test using JDK 17: I tried adding this to my pom.xml based on other answers: But when I build, I now get this error: Answer @Holger is right, you should not hack into JDK internals. He also explained correctly that –add-opens is not a valid Maven Compiler option. Because…

i can’t reference a String that exists

Im trying to run this code: but the R.string.default_web_client_id part isnt working (Cannot resolve symbol ‘default_web_client_id’). i know that the ‘default_web_client_id’ string exists, but it isnt at the String XML, its in a generated ‘values.xml’ am i doing something w…

Making a static final Json object in Java

I am currently building a Java Vertx application that executes a task periodically. This application is executes a certain logic and is supposed to return a value in a Json format. The logic seems to work and I don’t have a problem getting the desired value in the log, but I have trouble returning that …

Why can’t I make a group repeat in regex Java?

I have a regex I want to construct for validating the UNC syntax, which is: \serversharedfolderpath I don’t care about the server or folder characters, I exclusively want to validate the thing1thing2maybe3 syntax, the server and folder names will be validated separately. This is what I have so far: Thes…