mirror of
https://github.com/apache/activemq.git
synced 2025-02-10 03:56:21 +00:00
Backported fix from 4.1 branch for: https://issues.apache.org/activemq/browse/AMQ-948
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.0@451583 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
766bf50215
commit
039c2310c4
@ -201,22 +201,25 @@ public class Main {
|
||||
|
||||
if(activeMQHome==null){
|
||||
// guess from the location of the jar
|
||||
URL url = Main.class.getClassLoader().getResource("org/apache/activemq/broker/Main.class");
|
||||
URL url = Main.class.getClassLoader().getResource("org/apache/activemq/console/Main.class");
|
||||
if (url != null) {
|
||||
try {
|
||||
JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
|
||||
url = jarConnection.getJarFileURL();
|
||||
URI baseURI = new URI(url.toString()).resolve("..");
|
||||
activeMQHome = new File(baseURI).getCanonicalFile();
|
||||
System.setProperty("activemq.home",activeMQHome.getAbsolutePath());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(activeMQHome==null){
|
||||
activeMQHome = new File(".");
|
||||
activeMQHome = new File("../.");
|
||||
System.setProperty("activemq.home",activeMQHome.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
return activeMQHome;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user