![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am seeing that Sybase clears my JAVA_HOME environment variable for new shells launched by xp_cmdshell. From a database startup event I am calling a batch file which launches a java application and this depends on JAVA_HOME. Using SQL Anywhere Studio 9.0.0.1250 on Windows XP with all the latest updates. To duplicate this problem: set JAVA_HOME environment variable as a system variable to something like C:\jre1.4.2 create a test.bat file with the following commands: set pause create an event: CREATE EVENT LaunchJavaStuff TYPE DatabaseStart HANDLER BEGIN call xp_cmdshell('C:\\test.bat'); END; now trigger the event either manually or by restarting the database. Is this a bug? -Jim |
#3
| |||
| |||
|
|
Funny. It works for me on XP and 9.0. You are probably just making a minor deductive error. I suspect your JAVA_HOME environ is only set to the cmd prompt you are launching dbisql from. |
|
Set your *system* JAVA_HOME environ and then launch your server (as you would normally) and then that should clear this up for you. xp_cmdshell inherits the environment from the one the database server is running in. |
|
set JAVA_HOME environment variable as a system variable to something like C:\jre1.4.2 |
#4
| |||
| |||
|
|
I am seeing that Sybase clears my JAVA_HOME environment variable for new shells launched by xp_cmdshell. From a database startup event I am calling a batch file which launches a java application and this depends on JAVA_HOME. Using SQL Anywhere Studio 9.0.0.1250 on Windows XP with all the latest updates. To duplicate this problem: set JAVA_HOME environment variable as a system variable to something like C:\jre1.4.2 create a test.bat file with the following commands: set pause create an event: CREATE EVENT LaunchJavaStuff TYPE DatabaseStart HANDLER BEGIN call xp_cmdshell('C:\\test.bat'); END; now trigger the event either manually or by restarting the database. Is this a bug? -Jim |
#5
| |||
| |||
|
|
The launchers for dbisql, sc, dbconsole unset the JAVA_HOME environement variable so that they get the correct JRE that was installed with SQLAnywhere. But I've grep'ed the entire engine source tree and there are no references to JAVA_HOME there, so it does not touch it. Are you starting your engine from dbisql or sc? -- Mark Culp ASA Development ------------------------------------------------------------------------- ** Whitepapers, TechDocs, bug fixes are all available through the ** ** iAnywhere Developer Community at http://www.ianywhere.com/developer ** ------------------------------------------------------------------------- ------------------------------------------------------------------------- Jim Cullison wrote: I am seeing that Sybase clears my JAVA_HOME environment variable for new shells launched by xp_cmdshell. From a database startup event I am calling a batch file which launches a java application and this depends on JAVA_HOME. Using SQL Anywhere Studio 9.0.0.1250 on Windows XP with all the latest updates. To duplicate this problem: set JAVA_HOME environment variable as a system variable to something like C:\jre1.4.2 create a test.bat file with the following commands: set pause create an event: CREATE EVENT LaunchJavaStuff TYPE DatabaseStart HANDLER BEGIN call xp_cmdshell('C:\\test.bat'); END; now trigger the event either manually or by restarting the database. Is this a bug? -Jim |
![]() |
| Thread Tools | |
| Display Modes | |
| |