What is windows2000's system property (os.name)?
Thanks for replying!!!
Windows 2000
from:
System.err.println("OS NAME = ***"+System.getProperty("os.name")+"***");
prints out:
OS NAME = ***Windows 2000***
Similar Messages
-
How to get the system property - user.name from a client system
Hi All,
I have an application which would enable active users from the domain of the company. I want to get the name of the client from the system. I tried to run it on the local machine from Jdeveloper, it returned me the correct user name. But when the application is deployed on the Oracle Application server, and i hit the URL of the application, it returns the server URL.
I understand that the JSP works on the server side here but help me out to get a solution. I want to read the user name from the client side.
Thanks in advance!
AkhilAkhil,
I hope this will never work. Think about your requirement for a second....
This would mean an application is able to see my user credentials without my knowledge. It's bad enough the know my IP if I'm not using TOR.
To get your requirement to work you have to redefine it a bit. The user have to log in to your application. The application holds the name together with an ID of the session to know the user in further requests.
Thats a basic security theme, described in the dos [Adding Security to a Fusion Web Application|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/adding_security.htm] .
Timo -
Dear all,
I'm having trouble getting the system property user.name (which we need in our ant scripts) on our CentOS box. :(
When running the program below thru
java dumpproperties2
it prints "user.name='?'" on our CentOS 4.3. On win32 it works. It turns out that if you add the account corresponding to the EUID to /etc/passwd it works correctly. However, we don't use passwd authentication but an enterprise wide LDAP-system. Our /etc/nsswitch.conf says:
passwd: files ldap
One work around is to replace the java executable with a script that does
/path/to/jdk/bin/java -Duser.name=$USER -Duser.home=$HOME $@
Used jdk is j2se 1.5.0_13 Linux 32-bit.
Some questions for the experts:
1) Is there any other way?
2) Is it a known issue that Linux versions of the jdk just looks in /etc/passwd to map uid to user name (and home dir) instead of doing what the rest of the system, like whoami, does? I haven't found anything in either the readme or installation instructions, nor in the bug db.
Br, Jesper Tr�g�rdh
public class dumpproperties2 {
public static void main(String[] args) {
String s = System.getProperty("user.name");
System.out.println("user.name='" + s + "'");
}Does this work?
//public final class System
public static String getenv(String name)Then you can access the USER environment from inside Java. -
Applet reading System Propertery user.name
i got an applet which read the system property user.name .
i signed the applet. but still got accessdenied exception.
then i changed the java.policy file and the applet works fine.
but how can i do this for other users? is the java.policy file the only way? how can i make it easy for other users to run the applet?What I did for my applet was I create a certificate for the applet file using the command 'keytool' with some extra options such as -genkey and then I used 'jarsigner' to sign my JAR file.
You might want to google on how to use the keytool function.
I used to post a question regarding the applet policy file as well
http://forum.java.sun.com/thread.jspa?threadID=5206927&tstart=90
because what I wanted to do last time was to open up a file and also getting user name which is log on to the current computer.
Hopefully you can get your applet to work. Cheers. -
System property that represents a user's My Documents folder
Hi! What is the System property that points to a user's My Documents folder on Windows platform? Thanks!
>
Define "only".
I would imagine that there is a highly finite number
of file configurations on all Win OS 9x onwards and
System.property("os.name"); would resolve this with
only a few additional lines of code.
Actually, that's not true either... In Win 2K and above, the My Documents folder can be located in an almost infinite number of places, that are then mapped to a virtual My Documents folder.
This can include network locations (in the case where a user's Windows profile is stored on a central server instead of on each workstation), or with phyisical names other than "My Documents". For example, when using Win XP to connect to an Active Directory hosted on a Win 2003 server, the phyiscal location of the My Documents folder is actually named with the user's name - i.e. "John's Documents".
Even better, the name that is selected is not always the Windows login name - but could also be the alias that the user has created for themselves.
Anyway, here's the point: If you want your code to work on all Win platforms (today and in the future), you have to get the directory the way the Windows API says you have to get it: using the SHGetSpecialFolderLocation function. If you want to try to hack something together, then it might work in a lot of cases for a little while. But it is going to break at some point. Personally, if I know a piece of code I'm writing is going to cause my app to break in the future, I write it differently so that won't happen - but that's just me.
There's probably a way to find this info in the registry as well, but there is no guarantee that the location this information is stored in the registry will remain the same - if it changes, then the SHGetSpecialFolderLocation implementation will change.
- K -
What is the logical system name used for in R/3?
We have a R/3 server. The production client has a logical system name. What is the logical system name used for?
Tony TamHi Tony
Following Links will help you in understanding the concept
http://benstudycenter.blogspot.com/2008/02/logical-system.html
http://help.sap.com/saphelp_sm32/helpdata/en/78/217dc151ce11d189570000e829fbbd/frameset.htm
http://help.sap.com/saphelp_sm32/helpdata/en/78/217dc151ce11d189570000e829fbbd/frameset.htm
thanks
Bhudev -
How to specify class name in environment or system property
Hi,
Iam learning ejb. I was practicing the stateless session bean. I wrote a sample hello world application. While executing the client am getting the following error.
{color:#ff0000}Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at hw.HelloClient.main(HelloClient.java:20){color}
My Client program:
{color:#3366ff}package hw;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.*;
import java.util.*;
public class HelloClient {
public static void main(String[] args)throws Exception {
Properties prop = System.getProperties();
Context ctx= new InitialContext(prop); {color:#800000}// {color}{color:#800000}(Line no :20) here only error is pointing{color}
Object obj = ctx.lookup("HelloHome");
HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}{color}
please suggest me a solution.
note: iam using eclipse ganymede and jboss app server
Edited by: Arun_ece on Mar 10, 2009 1:13 AMHi,
You need to create a ejb-jar.xml and jboss.xml files to deploy the application on the servers.
Also, put these lines of codes after getting System Properties.
prop.put(Context.PROVIDER_URL, "iiop://localhost:[port_no]");Thanks,
Srikant -
How to specify alias name in system property while making 2way SSL con ?
Hi All,
I am tring to run a java client with 2way SSL which uses CAC card as keystore for the client. I have addded the following system property in my client program to make it work and change the java.security file to add pcks11 provider.
System.setProperty("javax.net.ssl.keyStoreType", "pkcs11");
System.setProperty("javax.net.debug", "ssl");
The program works fine and handshake is successfully done . But the problem is when i have more than one trusted certificate in the CAC card, it take a default certificate. I want to specify the certificate that should be used to do the client auth maybe specify the alias name . I didnt find any system property to do so.
Please let me know how to specify alias name as system property so that the 2way SSL used the specified alias for the client auth or is there any other way to specify the alias name. As in case i acccess the server URL from any browser i get a certificate selection prompt and the connection is established with the selected certificate.
Thanks in advanced,
RuhulI didn't find any system property to do so.There isn't one.
Please let me know how to specify alias name as system propertyYou can't.
You would have to write a custom KeyManager. See the JSSE Reference Guide. -
What is the list of possible OS names and OS versions, returned by OS name property?
My application is supposed to work a little bit differently running on different versions of Windows. For now the problem is that the possible strings returned by OS name and OS version (APP reference properties) are not specified in LV help. I've tested it for Win2k and got back "Windows NT" as a name and "5.0" as a version number. What should I expect for Windows ME, Windows 95, Windows XP?
Appreciate your responses, thanks for everybody who may have a clue of what it should be.System
Version9X
VersionNT
WindowsBuild
ServicePackLevel
Windows 95 (Gold)
400
950
Windows 95 + OSR
400
Windows 95 + OSR2
400
Windows 95 + OSR2.5
400
1111
Windows 98 (Gold)
410
1998
Windows 98 Second Edition
410
2222
Windows Me
490
3000.1
Windows NT 4.0 (Gold)
400
1381
Windows NT 4.0 + Service Pack 1
400
1381
1
Windows NT 4.0 + Service Pack 2
400
1381
2
Windows NT 4.0 + Service Pack 3
400
1381
3
Windows NT 4.0 + Service Pack 4
400
1381
4
Windows NT 4.0 + Service Pack 5
400
1381
5
Windows NT 4.0 + Service Pack 6
400
1381
6
Windows 2000
500
2195
Windows 2000 + Service Pack 1
500
2195
1
Windows XP
501
2600
Windows XP + Service Pack 1
501
2600
1
Windows Server 2003 family
502
Greater than 2600
I got List, but i cant sure LabVIEW is the same as above.
http://www.vitst.com
Virry Test & Control
LabVIEW Certified Developer -
Java gets the system property ????
I' am want create Java-Applet for get data system property in computer, when another computers used open this applet , give show data system property ( what os ?,quantity ram ?, quantity harddisk, name cd-rom ? etc. ) what can i do ????
Don't post this again. You already asked it here: http://forum.java.sun.com/thread.jsp?thread=401537&forum=31&message=1751719
-
System property via comman-line argument
Hi!
I have to create new System property and set it during launch of my application. I'm doing it this way:
Properties p = new Properties(System.getProperties());
try {
InputStream in = new ByteArrayInputStream(args[0].getBytes("UTF-8"));
p.load(in);
System.setProperties(p);
System.out.println(System.getProperty("datastorage"));
in.close();
catch(IOException e) {
e.printStackTrace();
}Is it OK? Sometimes I saw in command-line some argument, which contained "-D" in the beggining and appeared to be propety. What is it for? Should I use that too? I didn't find anything about that notation.
Thanks!What the heck are you trying to do here?
You can always specify system properties by using "-D" before the main method name (or jar name) on the command line:
java -cp . -DmyProperty=myValue my.MainClass -
System-property in param-value?
Hi all,
Is it possible to use a system-property override in a param-value element in the cache config? It doesn't seem to work for me. I have this:
<cache-mapping>
<cache-name>foo</cache-name>
<scheme-name>default-near</scheme-name>
<init-params>
<init-param>
<param-name>default-near-expiry-delay</param-name>
<param-value system-property="foo.expiry-delay"/>
</init-param>
</init-params>
</cache-mapping>
Setting -Dfoo.expiry-delay=1m on the command line doesn't take effect. I've also tried putting a default in param-value and it works, but not the override. What I'm trying to do is use the same scheme for different caches, but parameterize the expiry for each.
thanks
johnI just ran in to an inconvenient quirk. I thought I would be nice to add system properties for a number of caches so they will be there when I need them. I had something like this:
In the cache mapping:
<param-name>expiry-delay</param-name>
<param-value system-property="foo.expiry-delay"/>
In the scheme:
<expiry-delay>{expiry-delay 5m}</expiry-delay>
If I don't specify the foo.expiry-delay system property at all, I would like to get the default, but instead I get a NumberFormatException:
java.lang.NumberFormatException: passed String ("") must contain a number
at com.tangosol.util.Base.parseTime(Base.java:2756)
at com.tangosol.net.DefaultConfigurableCacheFactory.instantiateLocalCache(DefaultConfigurableCacheFactory.java:1
384)
at com.tangosol.net.DefaultConfigurableCacheFactory.configureBackingMap(DefaultConfigurableCacheFactory.java:969
at com.tangosol.net.DefaultConfigurableCacheFactory.configureCache(DefaultConfigurableCacheFactory.java:839)
at com.tangosol.net.DefaultConfigurableCacheFactory.ensureCache(DefaultConfigurableCacheFactory.java:284)
at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:606)
at com.tangosol.coherence.component.application.console.Coherence.doCache(Coherence.CDB:15)
at com.tangosol.coherence.component.application.console.Coherence.processCommand(Coherence.CDB:192)
at com.tangosol.coherence.component.application.console.Coherence.run(Coherence.CDB:39)
at com.tangosol.coherence.component.application.console.Coherence.main(Coherence.CDB:3)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.tangosol.util.ClassHelper.invoke(ClassHelper.java:746)
at com.tangosol.util.ClassHelper.invokeStatic(ClassHelper.java:689)
at com.tangosol.net.CacheFactory.main(CacheFactory.java:1115)
thanks -
System.getProperty("pc.name") ???
As the title of this post implies, I would like to get the PC name from within a client-side java app. Unfortunately "pc.name" is not a valid system property key. Nor are there any, as far as I can tell, that give me what I want.
Can anybody tell me how a client-side app can get the name of the PC on which it is running?
To be completely clear, I want the name that shows up when I click Start > Settings > Control Panel > System > Network Identification. (Yes, I'm running Win2K...)
Thanks!
BillHi,
:. Try this one. Comments in Portuguese.
class ... whatever you want, a library for instance.
public static final String OS_WINDOWS = "Windows";
public static final String OS_LINUX = "Linux";
public static final int CMD_SUCCESS = 0;
// = = = = = = = = = = = = = = = = = = = = = = =
// Carrega as variaveis de ambiente (#014)
public static boolean loadEnvironmentVariables()
{ boolean bRet = false;
String cmd = "";
String opsys = System.getProperty("os.name","");
try
{ if (opsys.startsWith(OS_LINUX)) cmd = "sh -c set";
if (opsys.startsWith(OS_WINDOWS)) cmd = "command.com /c set";
if (!cmd.equals(""))
{ Process p = Runtime.getRuntime().exec(cmd);
if (p.waitFor() == CMD_SUCCESS)
{ InputStream is = p.getInputStream();
Properties pr = new Properties(System.getProperties());
pr.load(is);
System.setProperties(pr);
bRet = true;
catch(Exception e) {}
finally
return bRet;
// = = = = = = = = = = = = = = = = = = = = = = =
// Hostname (#016)
public static String getHostname()
{ String sRet = "";
String opsys = System.getProperty("os.name","");
if (opsys.startsWith(OS_LINUX))
{ sRet = System.getProperty("HOSTNAME","");
else if (opsys.startsWith(OS_WINDOWS))
{ sRet = System.getProperty("COMPUTERNAME","");
return sRet;
// = = = = = = = = = = = = = = = = = = = = = = =
// Username (#017)
public static String getUsername()
{ String sRet = "";
String opsys = System.getProperty("os.name","");
if (opsys.startsWith(OS_LINUX))
{ sRet = System.getProperty("USER","");
else if (opsys.startsWith(OS_WINDOWS))
{ sRet = System.getProperty("USERNAME","");
return sRet;
:. First, call loadEnvironmentVariables method then getUsername, getHostname, etc. Hope it helps and it was what you meant.
Regards.
Roque. -
Operational override for write-delay (system-property)
Hi all,
I'm failing to get this xml element to validate within a cache config.
I'm using Coherence 3.7.1
<write-delay system-property="myproperty.override.write-delay" >10s</write-delay>.
the idea is to get the write-delay value atruntime through a system-property (-Dmyproperty.override.write-delay=5s for ex.)
I'm getting the following failure
Description
Location
Type
cvc-type.3.1.1: Element 'write-delay' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'system-property' was found.
line 41
XML Problem
Do you know if the override is valid at that location? The documentation says YES.
What am I doing wrongly?
Thanks,
HarryHello Leo_TA,
thanks for the answer.
Actually I need a default value which can be overriden at runtime as described in the documentation
http://docs.oracle.com/cd/E18686_01/coh.37/e18677/appendix_cacheconfig.htm#BHCECGCF
This is very handy to move conifguration items outside the cache-config.
Do you know why the xml woul dnot validate when system-property is used in the write-delay?
<?xml version="1.0" encoding="UTF-8"?>
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
</cache-config>
Coherence accepts it (when we force no xml validation (removing the xmlns)).
But I would like to use the xml validation to avoid miss-configurations.
Regards
Harry -
How to display system property in XML forms
Hi
We are using XML forms template for publishing news in KM. In the show form we got author field (a label in the form) which is mapped to system property createdby (PropertyReference = /Properties/default:createdby).But while displaying the form author is not getting populated. When I try to edit the form in XML forms builder in data model tab under properties node no property is visible. Nothing is shown up in properties even after reload option is selected from context menu of properties node.
I cheked by manually editing PropertyReference to some other property (e.g. modifiedby) but nothing is showing up.
Can you please suggest how the createdby system property can be shown in the xml form?
Thanks & Regards
SudipHi Sudeep,
Please try to open the formbuilder in another machine and try to see the properties xml form design view.
You can even directly can create a lable in show form and add the property name along with the nama space name.
For default properties namspace is default.Create a lable UI element in show form and select the datasource property and add the property value in that.
With we can show file related system generated properties in show form.
Regards,
Rudradev Devulapelli
Maybe you are looking for
-
Hi, I have been looking for a way to export huge datasets to CSV format for import with MySql. As sqlplus SPOOL turned out to be slow and difficult to use, I ended up coding my own importer using the OCCI library. I successfully compiled my code unde
-
Main Item net value showing as zero by condition type R100.
Hi Experts, I am configured free goods, maintained condition record for exclusive free goods. but in sales order free goods item is not populating and when i see the analysis the requirement 55 not met. I removed the requirement 55 and i saved it. St
-
Unable to Move Apple Apps in App Folder
I had to replace a failing disk in my computer since it's SMART "failing" status made Lion refuse to install. I did a clean install of OS X Lion on my Unibody MBP13" (2009) with a new Hard Drive about a week ago. I then migrated all my Apps, Settings
-
Work flow for invoice verification
I would like to know how to find out/display the workflow related to MIRO transaction code, miro is invoice verification, how to find the z table created for this workflow. given a work flow template number, how to view this template thanks
-
"New position" in standard HCM Transfer Process is empty
Hi Experts, In the HCM standard transfer process the 'Previous manager' selects an employee.Then he selects transfer process ,then he fills 'New Manager' & 'Transfer Reason' input field in the adode form.Finally he sends the adobe form to 'New Manag