Skip to content

Commit 4ed3fd8

Browse files
s12vjasontedor
authored andcommitted
Include duplicate jar when jarhell check fails
When the jarhell check fails due to a duplicate jar on the classpath, the exception message includes the full classpath but not the duplicated jar. For a long classpath, this can make it difficult to find the jar that is duplicated. This commit changes the exception message to include the duplicated jar. Relates #24953
1 parent 59b09c2 commit 4ed3fd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/elasticsearch/bootstrap/JarHell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static Set<URL> parseClassPath(String classPath) {
140140
URL url = PathUtils.get(element).toUri().toURL();
141141
if (urlElements.add(url) == false) {
142142
throw new IllegalStateException("jar hell!" + System.lineSeparator() +
143-
"duplicate jar on classpath: " + classPath);
143+
"duplicate jar [" + element + "] on classpath: " + classPath);
144144
}
145145
} catch (MalformedURLException e) {
146146
// should not happen, as we use the filesystem API

0 commit comments

Comments
 (0)