aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/launcher/SIPCommunicator.java
diff options
context:
space:
mode:
authorIngo Bauersachs <ingo@jitsi.org>2011-12-13 09:53:18 +0000
committerIngo Bauersachs <ingo@jitsi.org>2011-12-13 09:53:18 +0000
commit4f738af2bf211e74da0c3d1988e59b4e058438e1 (patch)
treedc831eba2dcdb6f02a7710f914eaf1a6307836f6 /src/net/java/sip/communicator/launcher/SIPCommunicator.java
parent7e30640fb9e56b3b336b4e1051b411721f4f4b8b (diff)
downloadjitsi-4f738af2bf211e74da0c3d1988e59b4e058438e1.zip
jitsi-4f738af2bf211e74da0c3d1988e59b4e058438e1.tar.gz
jitsi-4f738af2bf211e74da0c3d1988e59b4e058438e1.tar.bz2
Make DNSJAVA as SPI optional
Diffstat (limited to 'src/net/java/sip/communicator/launcher/SIPCommunicator.java')
-rw-r--r--src/net/java/sip/communicator/launcher/SIPCommunicator.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/launcher/SIPCommunicator.java b/src/net/java/sip/communicator/launcher/SIPCommunicator.java
index b4fad2f..72e18dd 100644
--- a/src/net/java/sip/communicator/launcher/SIPCommunicator.java
+++ b/src/net/java/sip/communicator/launcher/SIPCommunicator.java
@@ -58,10 +58,6 @@ public class SIPCommunicator
public static void main(String[] args)
throws Exception
{
- // this needs to be set before any DNS lookup is run (which includes the
- // Java SecurityManager)
- System.setProperty("sun.net.spi.nameservice.provider.1", "dns,dnsjava");
-
String version = System.getProperty("java.version");
String vmVendor = System.getProperty("java.vendor");
String osName = System.getProperty("os.name");
@@ -75,6 +71,14 @@ public class SIPCommunicator
*/
setScHomeDir(osName);
+ // this needs to be set before any DNS lookup is run
+ File f = new File(System.getProperty(PNAME_SC_HOME_DIR_LOCATION),
+ System.getProperty(PNAME_SC_HOME_DIR_NAME)
+ + File.separator + ".usednsjava");
+ if(f.exists())
+ System.setProperty(
+ "sun.net.spi.nameservice.provider.1", "dns,dnsjava");
+
if (version.startsWith("1.4") || vmVendor.startsWith("Gnu") ||
vmVendor.startsWith("Free"))
{
@@ -147,10 +151,13 @@ public class SIPCommunicator
* and net.java.sip.communicator.SC_HOME_DIR_NAME (if they aren't already
* set) in accord with the OS conventions specified by the name of the OS.
*
+ * Please leave the access modifier as package (default) to allow launch-
+ * wrappers to call it.
+ *
* @param osName the name of the OS according to which the SC_HOME_DIR_*
* properties are to be set
*/
- private static void setScHomeDir(String osName)
+ static void setScHomeDir(String osName)
{
/*
* Though we'll be setting the SC_HOME_DIR_* property values depending
@@ -249,7 +256,7 @@ public class SIPCommunicator
System.setProperty(PNAME_SC_HOME_DIR_LOCATION, location);
System.setProperty(PNAME_SC_HOME_DIR_NAME, name);
}
-
+
// when we end up with the home dirs, make sure we have log dir
new File(location, name + File.separator + "log").mkdirs();
}