1diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
2index 7c951cee51..bcc61ff43d 100644
3--- a/src/hotspot/os/linux/os_linux.cpp
4+++ b/src/hotspot/os/linux/os_linux.cpp
5@@ -416,18 +416,8 @@
6 // 1: ...
7 // ...
8 // 7: The default directories, normally /lib and /usr/lib.
9-#ifndef OVERRIDE_LIBPATH
10- #if defined(_LP64)
11- #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
12- #else
13- #define DEFAULT_LIBPATH "/lib:/usr/lib"
14- #endif
15-#else
16- #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
17-#endif
18
19 // Base path of extensions installed on the system.
20-#define SYS_EXT_DIR "/usr/java/packages"
21 #define EXTENSIONS_DIR "/lib/ext"
22
23 // Buffer that fits several snprintfs.
24@@ -435,7 +425,7 @@
25 // by the nulls included by the sizeof operator.
26 const size_t bufsize =
27 MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
28- (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
29+ (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
30 char *buf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
31
32 // sysclasspath, java_home, dll_dir
33@@ -482,24 +472,20 @@
34 // should always exist (until the legacy problem cited above is
35 // addressed).
36 const char *v = ::getenv("LD_LIBRARY_PATH");
37- const char *v_colon = ":";
38- if (v == NULL) { v = ""; v_colon = ""; }
39- // That's +1 for the colon and +1 for the trailing '\0'.
40- size_t pathsize = strlen(v) + 1 + sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1;
41+ if (v == NULL) { v = ""; }
42+ size_t pathsize = strlen(v) + 1;
43 char *ld_library_path = NEW_C_HEAP_ARRAY(char, pathsize, mtInternal);
44- os::snprintf_checked(ld_library_path, pathsize, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon);
45+ os::snprintf_checked(ld_library_path, pathsize, "%s", v);
46 Arguments::set_library_path(ld_library_path);
47 FREE_C_HEAP_ARRAY(char, ld_library_path);
48 }
49
50 // Extensions directories.
51- os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
52+ os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
53 Arguments::set_ext_dirs(buf);
54
55 FREE_C_HEAP_ARRAY(char, buf);
56
57-#undef DEFAULT_LIBPATH
58-#undef SYS_EXT_DIR
59 #undef EXTENSIONS_DIR
60 }
61