changes to include local jre as part of the path

This commit is contained in:
benfry
2003-10-26 03:21:39 +00:00
parent 9bf7451842
commit 0cd50376e8
3 changed files with 27 additions and 4 deletions
+7 -2
View File
@@ -4,8 +4,13 @@ REM --- if you're running out of memory, change the 128m
REM --- (which means 128 megabytes) to something higher.
set SAVEDCP=%CLASSPATH%
set CLASSPATH=java\lib\rt.jar;java\lib\jaws.jar;lib;lib\build;lib\pde.jar;lib\kjc.jar;lib\antlr.jar;lib\oro.jar;lib\comm.jar;%windir%\system32\qtjava.zip;%windir%\system\qtjava.zip
set SAVEDPATH=%PATH%
start .\java\bin\javaw -ms128m -mx128m PdeBase
set CLASSPATH=java\lib\rt.jar;java\lib\jaws.jar;lib;lib\build;lib\pde.jar;lib\kjc.jar;lib\antlr.jar;lib\oro.jar;lib\comm.jar;%windir%\system32\qtjava.zip;%windir%\system\qtjava.zip
set PATH=java\bin;%PATH%
start javaw -ms128m -mx128m PdeBase
REM start .\java\bin\javaw -ms128m -mx128m PdeBase
set CLASSPATH=%SAVEDCP%
set PATH=%SAVEDPATH%
@@ -195,6 +195,21 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
return 0;
}
// need to add the local jre to the path for 'java mode' in the env
if (local_jre_installed) {
char *env_path = (char *)malloc(512 * sizeof(char));
strcpy(env_path, getenv("PATH"));
char *paf = (char *)malloc(1024 * sizeof(char));
sprintf(paf, "%s\\java\\bin;%s", loaddir, env_path);
if (!SetEnvironmentVariable("PATH", paf)) {
MessageBox(NULL, "Could not set PATH environment variable",
"Processing Error", MB_OK);
return 0;
}
}
//MessageBox(NULL, cp, "whaadddup", MB_OK);
// add the name of the class to execute and a space before the next arg