< prev index next >

src/java.base/unix/native/libjava/java_props_md.c

Print this page

        

@@ -66,15 +66,10 @@
 #define CODESET ALT_CODESET_KEY
 #endif
 #endif
 #endif /* !_ALLBSD_SOURCE */
 
-#ifdef JAVASE_EMBEDDED
-#include <dlfcn.h>
-#include <sys/stat.h>
-#endif
-
 /* Take an array of string pairs (map of key->value) and a string (key).
  * Examine each pair in the map to see if the first string (key) matches the
  * string.  If so, store the second string of the pair (value) in the value and
  * return 1.  Otherwise do nothing and return 0.  The end of the map is
  * indicated by an empty string at the start of a pair (key of "").

@@ -348,40 +343,10 @@
     free(encoding_variant);
 
     return 1;
 }
 
-#ifdef JAVASE_EMBEDDED
-/* Determine the default embedded toolkit based on whether libawt_xawt
- * exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX
- */
-static char* getEmbeddedToolkit() {
-    Dl_info dlinfo;
-    char buf[MAXPATHLEN];
-    int32_t len;
-    char *p;
-    struct stat statbuf;
-
-    /* Get address of this library and the directory containing it. */
-    dladdr((void *)getEmbeddedToolkit, &dlinfo);
-    realpath((char *)dlinfo.dli_fname, buf);
-    len = strlen(buf);
-    p = strrchr(buf, '/');
-    /* Default AWT Toolkit on Linux and Solaris is XAWT (libawt_xawt.so). */
-    strncpy(p, "/libawt_xawt.so", MAXPATHLEN-len-1);
-    /* Check if it exists */
-    if (stat(buf, &statbuf) == -1 && errno == ENOENT) {
-        /* No - this is a reduced-headless-jre so use special HToolkit */
-        return "sun.awt.HToolkit";
-    }
-    else {
-        /* Yes - this is a headful JRE so fallback to SE defaults */
-        return NULL;
-    }
-}
-#endif
-
 /* This function gets called very early, before VM_CALLS are setup.
  * Do not use any of the VM_CALLS entries!!!
  */
 java_props_t *
 GetJavaProperties(JNIEnv *env)

@@ -422,14 +387,10 @@
 
     // check if we're in a GUI login session and set java.awt.headless=true if not
     sprops.awt_headless = isInAquaSession() ? NULL : "true";
 #else
     sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
-#ifdef JAVASE_EMBEDDED
-    sprops.awt_toolkit = getEmbeddedToolkit();
-    if (sprops.awt_toolkit == NULL) // default as below
-#endif
     sprops.awt_toolkit = "sun.awt.X11.XToolkit";
 #endif
 
     /* This is used only for debugging of font problems. */
     v = getenv("JAVA2D_FONTPATH");
< prev index next >