This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- i used it on windows xp platform
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 04, 2008
07:24 AM
please verify why this code does not work
hi,
i got this custom code from the samples but it does not seem to work as the system environment variables are not getting refreshed.
I used system.out.println after setting environment variable and using refresh environment action but it simply does not output anything.
It is not setting the environment variable.
i wrote the following code but it prints null
String mystr=System.getEnv("MY_HOME");
System.out.println(mystr);
String anotherPlace=mystr+"\\My.properties";
File myFile=new File(anotherPlace);
I use it on windows xp
where am i wrong and the stack trace of stdout.log is
ExtractToFile: target = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\I1202120738\Windows\refresh.dll
ExtractToFile: extractWhatURL = jar:file:/C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temp/I1202120738/InstallerData/Execute.zip!/refresh.dll
i got this custom code from the samples but it does not seem to work as the system environment variables are not getting refreshed.
I used system.out.println after setting environment variable and using refresh environment action but it simply does not output anything.
It is not setting the environment variable.
i wrote the following code but it prints null
String mystr=System.getEnv("MY_HOME");
System.out.println(mystr);
String anotherPlace=mystr+"\\My.properties";
File myFile=new File(anotherPlace);
I use it on windows xp
where am i wrong and the stack trace of stdout.log is
ExtractToFile: target = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\I1202120738\Windows\refresh.dll
ExtractToFile: extractWhatURL = jar:file:/C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temp/I1202120738/InstallerData/Execute.zip!/refresh.dll
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 04, 2008
07:25 AM
On what platform does this happen?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 04, 2008
09:03 AM
What gets printed out when you run this code? Adding other debug lines may help tell you exactly where you are in the code.
Try
System.out.println("MyStr = " + mystr);
Another thing, you don't need to create the variable anotherPlace. Instead, just use File myFile = new File(mystr, "My.properties");
Try
System.out.println("MyStr = " + mystr);
Another thing, you don't need to create the variable anotherPlace. Instead, just use File myFile = new File(mystr, "My.properties");
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 05, 2008
09:58 PM
hi,
i used it on windows xp platform.
james.
i used it on windows xp platform.
james.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 05, 2008
10:02 PM
hi
the answer i got here is
MYSTR=null
What shall i do now???????????????/////
the answer i got here is
MYSTR=null
What shall i do now???????????????/////
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 05, 2008
10:08 PM
hi,
i added execute custom code after setting the environment varaibles and then gave refreshenvironment.jar in the custom code archive path and then i gave
RefreshEnvironment in the class.
I dont know where i am going wrong but it simply does not refresh the system environment variables for use without restarting the system
i added execute custom code after setting the environment varaibles and then gave refreshenvironment.jar in the custom code archive path and then i gave
RefreshEnvironment in the class.
I dont know where i am going wrong but it simply does not refresh the system environment variables for use without restarting the system
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
06:04 AM
hi,
i have a issue out here in that the refresh environment class does not work
as when i used this line say,i got null.
String letMeSee=System.getEnv("XXX_HOME");
System.out.println("will it be printed"+letMeSee);
i got output as this:
"will it be printed"null
It means the environment variables are not getting refreshed.
i have a issue out here in that the refresh environment class does not work
as when i used this line say,i got null.
String letMeSee=System.getEnv("XXX_HOME");
System.out.println("will it be printed"+letMeSee);
i got output as this:
"will it be printed"null
It means the environment variables are not getting refreshed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
10:06 AM
Ok here goes....
When you are making a System.getenv() call, you are getting settings for the current Virtual Machine. Just because you changed the "environment" at the system level, doesn't mean the currently running JVM environment has been updated. Just like if you opened a cmd window. That window has a particular environment. That environment doesn't get automatically updated because you changed it at the "system" level. It only gets updated when you explicitly set it or you open a new cmd window.
There are 2 ways aound this.
1. Use a System.setProperty(key, value) call.
or 2. You said that in IA, you were setting the variable. Why not just use that variable?
When you are making a System.getenv() call, you are getting settings for the current Virtual Machine. Just because you changed the "environment" at the system level, doesn't mean the currently running JVM environment has been updated. Just like if you opened a cmd window. That window has a particular environment. That environment doesn't get automatically updated because you changed it at the "system" level. It only gets updated when you explicitly set it or you open a new cmd window.
There are 2 ways aound this.
1. Use a System.setProperty(key, value) call.
or 2. You said that in IA, you were setting the variable. Why not just use that variable?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
10:20 PM
hi,
i set system environment variable JAVA_HOME if jdk is not there and i use it to start script file.What to do when it refers to the new JDK.
When i set the system environment variable in installer will it get refreshed.
Say i set JAVA_HOME will it get refreshed,I am not sure .I did not find it happening.
james.
i set system environment variable JAVA_HOME if jdk is not there and i use it to start script file.What to do when it refers to the new JDK.
When i set the system environment variable in installer will it get refreshed.
Say i set JAVA_HOME will it get refreshed,I am not sure .I did not find it happening.
james.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)