Hi!
I'm developing a multi platform application with Java and have encountered a Problem:
At one point, the application should find out the systems language or country. However, when I use
[CODE=java]
System.getPrope rty(...)
[/CODE]I found, that with Windows with JRE 1.6.0_02 the property is "user.langu age" or "user.count ry" and under Ubuntu Linux with JRE 1.4.2 it's "user.langu age" or "user.regio n".
Now I'm wondering: Is that dependent on the version of JRE or is it platform dependent or is it something even more complicated? And also, what other Properties are there, that give this information on other Systems? For example: Does Solaris have different Properties? (Macs aren't of necessary, though I wouldn't mind.) Is "user.langu age" offered on every system?
Of course, if anyone knows a better way of retrieving the systems language, I'm open to that.
Greetings,
Nepomuk
P.S.: This is the code I used to find those properties:
[CODE=java]
public class Properties {
public static void main(String[] args)
{
if (args == null || args.length == 0)
{
java.util.Enume ration e = System.getPrope rties().propert yNames();
while (e.hasMoreEleme nts())
{
String key = (String)e.nextE lement();
System.out.prin tln(key +"\t : \t"+ System.getPrope rty(key));
}
}
else
{
for (int n = 0; n < args.length; ++ n)
{
if (args[n] != null && args[n].length() > 0)
{
String p = System.getPrope rty(args[n]);
if (p != null)
System.out.prin tln(p);
}
}
}
}
}
[/CODE]
[/CODE]
I'm developing a multi platform application with Java and have encountered a Problem:
At one point, the application should find out the systems language or country. However, when I use
[CODE=java]
System.getPrope rty(...)
[/CODE]I found, that with Windows with JRE 1.6.0_02 the property is "user.langu age" or "user.count ry" and under Ubuntu Linux with JRE 1.4.2 it's "user.langu age" or "user.regio n".
Now I'm wondering: Is that dependent on the version of JRE or is it platform dependent or is it something even more complicated? And also, what other Properties are there, that give this information on other Systems? For example: Does Solaris have different Properties? (Macs aren't of necessary, though I wouldn't mind.) Is "user.langu age" offered on every system?
Of course, if anyone knows a better way of retrieving the systems language, I'm open to that.
Greetings,
Nepomuk
P.S.: This is the code I used to find those properties:
[CODE=java]
public class Properties {
public static void main(String[] args)
{
if (args == null || args.length == 0)
{
java.util.Enume ration e = System.getPrope rties().propert yNames();
while (e.hasMoreEleme nts())
{
String key = (String)e.nextE lement();
System.out.prin tln(key +"\t : \t"+ System.getPrope rty(key));
}
}
else
{
for (int n = 0; n < args.length; ++ n)
{
if (args[n] != null && args[n].length() > 0)
{
String p = System.getPrope rty(args[n]);
if (p != null)
System.out.prin tln(p);
}
}
}
}
}
[/CODE]
[/CODE]
Comment