Skip to content

Tag: classpath

How to set the classpath correctly in java

I need to compile and run simple code using the gson library, but I can’t use Maven, Gradle or the IDE. The directory contains Main.java and gson-2.9.0.jar javac -cp gson-2.9.0.jar Main.java works correctly and creates Main.class But when I run java -cp ./*: Main, I get I also tried the following comman…

Read properties file from classpath (non-maven)

When I try to run my jar from another directory it cannot see the “config” folder with the “url.properties” file in it. Inside MyProperties class I have the following code, which runs perfectly when run from the same dir: The class that contains this code is in the following tree: It r…

cmd window does not recognize the classpath option

when I enter like error occurs like this What’s problem? Answer You appear to be using a Linux/Unix system, based on your error: zsh: command not found: mariadb-java-client-2.7.1.jar. Your Java command therefore needs to use a colon :, not a semicolon ;. Semicolons are the JAR separators used on Windows…