Index: vm/vmcore/src/class_support/classloader.cpp =================================================================== --- vm/vmcore/src/class_support/classloader.cpp (revision 713673) +++ vm/vmcore/src/class_support/classloader.cpp (working copy) @@ -1655,19 +1655,36 @@ /* * set VM_BOOT_CLASS_PATH and SUN_BOOT_CLASS_PATH for any code * that needs it + * Before doing that, we exclude any repeated elements */ - m_env->VmProperties()->set(VM_BOOT_CLASS_PATH, vmboot); - m_env->JavaProperties()->set(VM_BOOT_CLASS_PATH, vmboot); - m_env->JavaProperties()->set(SUN_BOOT_CLASS_PATH, vmboot); // create temp pool for apr functions apr_pool_t *tmp_pool; apr_pool_create(&tmp_pool, NULL); + + char *cleanVMBoot = (char*)STD_MALLOC(strlen(vmboot) + 1); + cleanVMBoot[0] = '\0'; + char *path_name = strtok(vmboot, PORT_PATH_SEPARATOR_STR); + while (path_name) + { + //Format the classpath to a standard absolute path. + // Maybe such statement should be removed from SetBCPElement + const char* canoname = port_filepath_canonical(path_name, tmp_pool); + if (strstr(cleanVMBoot, canoname) == NULL) { + SetBCPElement(canoname, tmp_pool); + strcat(cleanVMBoot, canoname); + strcat(cleanVMBoot, PORT_PATH_SEPARATOR_STR); + } + path_name = strtok(NULL, PORT_PATH_SEPARATOR_STR); + } + + m_env->VmProperties()->set(VM_BOOT_CLASS_PATH, cleanVMBoot); + m_env->JavaProperties()->set(VM_BOOT_CLASS_PATH, cleanVMBoot); + m_env->JavaProperties()->set(SUN_BOOT_CLASS_PATH, cleanVMBoot); - // create a bootclasspath collection - SetClasspathFromString(vmboot, tmp_pool); STD_FREE(vmboot); + STD_FREE(cleanVMBoot); // check if vm.bootclasspath.appendclasspath property is set to true if( TRUE == vm_property_get_boolean("vm.bootclasspath.appendclasspath", FALSE, VM_PROPERTIES) ) {