system variables

Z

[ZaToPeK]

Hello i have in my system some variables:
TOMCAT_HOME
CLASSPATH
CATALINA_HOME
......
how can i load them into some strings?
i am trying with this:
Properties properties = System.getProperties();
Enumeration claves = properties.keys();
while( claves.hasMoreElements() ){
String clave = (String)claves.nextElement();
String valor = properties.getProperty( clave );
System.out.println(clave+" : " + valor);
}

but it doesn't load those variables.

Can anybody helps me?
thanks
 
M

manuel aldana

Hello i have in my system some variables:
TOMCAT_HOME
CLASSPATH
CATALINA_HOME
.....
how can i load them into some strings?
i am trying with this:
Properties properties = System.getProperties();
Enumeration claves = properties.keys();
while( claves.hasMoreElements() ){
String clave = (String)claves.nextElement();
String valor = properties.getProperty( clave );
System.out.println(clave+" : " + valor);
}

but it doesn't load those variables.

it won't load these variables, because not all oses support envvariables
and java tries to be platform independant. using getProperties() you
only get some variables set in the JRE.

but there is another way to import "foreign(in view of java)" vars as
system properties. just use the java option -D when starting a java-prog.

for more info type 'java -help'.
 
M

[Miren]

i want form one java program, that runs into one tomcat, to load some
system properties.
is this posbile?

manuel aldana said:
Hello i have in my system some variables:
TOMCAT_HOME
CLASSPATH
CATALINA_HOME
.....
how can i load them into some strings?
i am trying with this:
Properties properties = System.getProperties();
Enumeration claves = properties.keys();
while( claves.hasMoreElements() ){
String clave = (String)claves.nextElement();
String valor = properties.getProperty( clave );
System.out.println(clave+" : " + valor);
}

but it doesn't load those variables.

it won't load these variables, because not all oses support envvariables
and java tries to be platform independant. using getProperties() you
only get some variables set in the JRE.

but there is another way to import "foreign(in view of java)" vars as
system properties. just use the java option -D when starting a java-prog.

for more info type 'java -help'.



--
manuel aldana

e-mail adress not valid
--> use aldana[at]cs.tu-berlin.de
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top