Skip to content

Tag: path

.jar File can’t find image file path

I’m creating a simple program that I now want to export as a executable jar file. Everything works fine except the jar file can’t find the image. For creating the runnable JAR file I used the second option in Eclipse 2021-12 (Package required libraries into generated JAR). This seems to work well,…

IntelliJ IDEA java directory paths problem

I have a problem with paths. I’ve got a test project like this below and I want to create a JSON reader in Main so I need a test_json path. I don’t wanna use an absolute path D:…, but a path “from project” (I mean smth like main://resources/json_test/test_json.json). Is there any…

How to create a Path to a non existent file

How can I create a Path to a file which is guaranteed not to exist? I thought about using an “impossible” path name, such as: But somebody could create such a file, making my code fail. Update I have written a method which accepts a Path and then tries to read from the underlying file, and now I a…

How to downgrade JDK?

Currently my Java version is 17. Neo4j requires me to install Java 11 or OpenJDK 11, or else it will give the error java.lang.IllegalAccessException: module java.base does not open java.nio to unnamed module @1817d444. I guess I need to downgrade to JDK 11. Java Platform, Standard Edition 11 Reference Impleme…

Get error when trying to split file path in Java

For the above code, I get the following output where p is a Path object. C:repoUnit-test-coverageabcdunit-test-repopcmbbsourcepcmbbdatabaseWorkOrderTenderUtil.plsql I want to get the file name without extension. So I tried the below code. Then I got the following output. WorkOrderTenderUtil.plsql To get the f…