/
means root filesystem folder in *nix, so /sample_config.xml
is a file in the root folder.
Just sample_config.xml
would be relative to the folder where the program was started from, not relative to the class file location.
The best way to load files from the Java classpath (and your class is in classpath) is via resource loading mechanism. Please follow this link for details: URL to load resources from the classpath in Java
Or, if you can't change the way resources get loaded you need to get the URL of the resource with Class.getResource and pass the path to Util.load
.
Something like this should work in your case:
// getResource returns URL relative to this class
URL url = this.getClass().getResource("sample_config.xml");
if(url != null) // if file is not there url will be null
Util.load(url.getPath());