Community
Participate
Working Groups
String jarPath = mainClass.getProtectionDomain().getCodeSource().getLocation().getPath();//get the path of the currently running jar String filename = URLDecoder.decode(jarPath, "UTF-8").substring(1); this code without the jar in jar loader will return the absolute path of your jar in eclipse. Once compiled with the option to embed libraries as jars in your jar it will now print "\" instead of the file. Also switching the option to embedding libraries instead of packaging the jars will fix the issue proving it's your jar in jar loader that's the issue. I understand you needed to modify the absolute path for jars that are inside of jars but, you shouldn't mess with jars that are actual files. Please fix this it's annoying to work around. I had to do this as a workaround for my program boolean compiled = getExtension(new File(filename)).equals("jar") || getMainClass().getName().equals("org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"); Since this has to do with java jar in jar loader program it effects all os's and should be fixed asap
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.