dbTalk Databases Forums  

JAVA_HOME environment variable begin cleared

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss JAVA_HOME environment variable begin cleared in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Cullison
 
Posts: n/a

Default JAVA_HOME environment variable begin cleared - 12-17-2003 , 10:33 AM






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



Reply With Quote
  #2  
Old   
Nick Elson
 
Posts: n/a

Default Re: JAVA_HOME environment variable begin cleared - 12-17-2003 , 11:21 AM






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.


"Jim Cullison" <c_u_l_l_i_s_o_n_j (AT) p_o_s_i_m_ (DOT) _n_e_t> wrote

Quote:
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





Reply With Quote
  #3  
Old   
Jim Cullison
 
Posts: n/a

Default Re: JAVA_HOME environment variable begin cleared - 12-17-2003 , 11:31 AM



"Nick Elson" <no_spam_nicelson (AT) sybase (DOT) com> wrote

Quote:
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.
I am not launching dbisql. Have you tried it from within a stored procedure
or event?

Quote:
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.
Yes, I understand the inheritance of the environment.
You missed this line in my post:

Quote:
set JAVA_HOME environment variable as a system variable to something
like
C:\jre1.4.2
I have had JAVA_HOME set as a system variable since shortly after the OS was
installed. Launching cmd and typing set, JAVA_HOME has the right path.

Jim




Reply With Quote
  #4  
Old   
Mark Culp
 
Posts: n/a

Default Re: JAVA_HOME environment variable begin cleared - 12-17-2003 , 11:56 AM



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:
Quote:
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

Reply With Quote
  #5  
Old   
Jim Cullison
 
Posts: n/a

Default Re: JAVA_HOME environment variable begin cleared - 12-17-2003 , 12:13 PM



I was starting the database from Sybase Central. I changed to a service and
that fixed it.

Thanks!
Jim

"Mark Culp" <reply_to_newsgroups_only_please_nospam_mark.cul p (AT) iAnywhere (DOT) com>
wrote in message news:3FE095C8.1C152C68 (AT) iAnywhere (DOT) com...
Quote:
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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.