Relative path in Java for program that run on other machines

39 views Asked by At

I'm working on a Java program, and I need a relative path from the class KMeansMiner to the "file" folder. So far, I've been using an absolute path, and it worked fine, but now I need to run the program on other machines. I've seen some solutions here, but they don't seem to work. I've also tried a few solutions myself, but nothing seems to be working. I was advised against using "/", "../", etc., because they are specific to Windows. Can anyone provide me with a solution or an idea?

This is the structure of my project:
This is the structure of my project

I need a relative path to navigate back to the 'file' folder that has nothing to do with the JAR files.

0

There are 0 answers