# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: E:\nb\nb_all\ide\launcher\windows # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: netbeans.cpp *** E:\nb\nb_all\ide\launcher\windows\netbeans.cpp Base (1.26) --- E:\nb\nb_all\ide\launcher\windows\netbeans.cpp Locally Modified (Based On 1.26) *************** *** 36,41 **** --- 36,42 ---- static int readClusterFile(const char* path); static int dirExists(const char* path); static void ErrorExit(LPTSTR lpszMessage, LPTSTR lpszFunction); + static char *readEndorsedDirs(const char *progdir, char **clusterDirs, char *pOptions); static char userdir[MAX_PATH] = "c:\\nbuser"; static char options[4098] = ""; *************** *** 135,149 **** strcat(nbexec, "\\lib\\nbexec.exe"); ! sprintf(cmdline2, "\"%s\" %s -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense --branding nb --clusters \"%s\" --userdir \"%s\" %s %s", nbexec, jdkswitch, dirs, userdir, options, cmdline); --- 136,150 ---- strcat(nbexec, "\\lib\\nbexec.exe"); ! char *pEndorsedDirs = readEndorsedDirs(topdir, defaultDirs, options); ! ! sprintf(cmdline2, "\"%s\" %s -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense --branding nb --clusters \"%s\" --userdir \"%s\" %s \"%s\" %s", nbexec, jdkswitch, dirs, userdir, options, + pEndorsedDirs, cmdline); STARTUPINFO start; *************** *** 545,547 **** --- 549,579 ---- ExitProcess( (dw != 0)? dw: 1); } + /* Looks for modules/ext/jaxws20/api directory in enterprise cluster and if it + * exists returns string that will init java.endorsed.dirs property to this directory + * If the directory does not exist or pOptions defines this property empty string + * is returned. + */ + char *readEndorsedDirs(const char *progdir, char **clusterDirs, char *pOptions) { + if (strstr(pOptions, "-J-Djava.endorsed.dirs=")) { + return ""; + } + for (char **clusterName = clusterDirs; *clusterName != NULL; clusterName++) { + if (strstr(*clusterName, "ide")) { + char *endorsedParam = (char *) malloc(60+strlen(*clusterName)+strlen(progdir)); + strcpy(endorsedParam, "-J-Djava.endorsed.dirs=\""); + strcat(endorsedParam, progdir); + strcat(endorsedParam, "\\"); + strcat(endorsedParam, *clusterName); + strcat(endorsedParam, "\\modules\\ext\\jaxws21\\api"); + #ifdef DEBUG + printf("Searching for : >%s<\n", endorsedParam+24); + #endif + if (dirExists(endorsedParam+24)) { + strcat(endorsedParam, "\""); + return endorsedParam; + } + } + } + return ""; + }