This one works for me:
return Path.of(ClassLoader.getSystemResource(resourceName).toURI());
More Related Contents:
- What is the point of the diamond operator () in Java?
- Java error: Comparison method violates its general contract
- How should I use try-with-resources with JDBC?
- No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
- Can Java 8 code be compiled to run on Java 7 JVM?
- Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupported major.minor version 51.0) [duplicate]
- Java 7 (JDK 7) garbage collection and documentation on G1
- Generic type inference not working with method chaining?
- How to set -source 1.7 in Android Studio and Gradle
- Why is my URI not hierarchical? [duplicate]
- Java Thread priority has no effect
- How to enable TLS 1.2 in Java 7
- Can’t transparent and undecorated JFrame in JDK7 when enabling nimbus
- Android import java.nio.file.Files; cannot be resolved
- java.lang.VerifyError: Expecting a stackmap frame at branch target JDK 1.7
- “Comparison method violates its general contract!” – TimSort and GridLayout
- Java 7 String – substring complexity
- Technically what is the main difference between Oracle JDK and OpenJDK? [duplicate]
- Maximum size of a method in Java 7 and 8
- Java 7 default locale
- In a Java 7 multicatch block what is the type of the caught exception?
- Compiler error : reference to call ambiguous
- Java G1 garbage collection in production
- Is The Java Tutorials Translucent Window example giving trouble to those playing with jdk7?
- How to set IntelliJ IDEA Project SDK
- Differences in auto-unboxing between Java 6 vs Java 7
- How to install java jdk 7 on Snow Leopard
- Java 7 Automatic Resource Management JDBC (try-with-resources statement)
- javafx 8 compatibility issues – FXML static fields or methods
- Close resource quietly using try-with-resources