Skip to content

Tag: classpath

Gradle – add directory to classpath

My application requires that a config directory be available on the classpath when it looks for configurations files under the directory. I currently have dependencies configured like so, though this is probably not the correct way to make a directory available to my application: I am using the application pl…

Spring Boot classpath

In the Spring Boot’s docs here, about serving static content, it says: By default Spring Boot will serve static content from a directory called /static (or /public or /resources or /META-INF/resources) in the classpath. I found that all the content in the directory: will be copied inside the classpath, …

How to share code between two projects?

I have two Java projects called A and B. Both of them are web apps deployed as war files. I created them in Eclipse workspace separately. Project B uses a class in project A named MusicMapper. I added the project A to project B’s build path in Eclipse as suggested in this post. So now project B can comp…

Cannot find class even when jar file is in working directory

I am struggling to get my Java program to run on AIX. I used Eclipse on Windows to create a runnable Jar file, jRams.jar below. I kept on getting a class not found error, until finally I put all the external libraries in the same directory. Still, I get the class not found error. jremote.jar definitely contai…

How to run a java class with a jar in the classpath?

So, I can do this very well: if ./mypackage/MyClass.class exists. I can also happily do this: if the class file exists in the appropriate part of the jar. Easy stuff. But I can’t for the life of me manage to do something like this: where ./mypackage/MyClass.class exists, and where ./utilities.jar exists…