System configuration using java

Hi friends
Can I get System configuration using java code.
If yes plz suggest how.
thanks in advance.. Anjana

some bits and pieces are available see the details in
System.getProperties():
Properties sysProps  = System.getProperties();
meration en       = sysProps.keys();
while ( en.hasMoreElements() )
//add the key=value pairs
Object keyObj    = en.nextElement();
String key       = ( String ) keyObj;
Object valueObj  = sysProps.getProperty( key );
System.out.println( key + " : " +
+ valueObj.toString());
de]
just an idea??YES, and also you can do
System.getenv();but they also don't give all the info the OP was/is looking for.

Similar Messages

  • How to know the system configuration using Java.

    Hello Everyone,
    I wanna know the system configuration (Hard Disk size,Ram capacity,Processor speed) .Can we know it using Java API? Or else is there any API which makes my life easier?
    Can someone let me know,please?
    All ur answers r most welcome.
    Thanks

    --> provides you with some basic info on os user and os but my best bet is to find a windows system file that maintains this information and then read the data from it
    import com.sun.servicetag.SystemEnvironment;
    SystemEnvironment se = SystemEnvironment.getSystemEnvironment();
            System.out.println(se.getCpuManufacturer());
            System.out.println(se.getHostId());
            System.out.println(se.getHostname());
            System.out.println(se.getOsArchitecture());
            System.out.println(se.getOsName());
            System.out.println(se.getOsVersion());
            System.out.println(se.getSerialNumber());
            System.out.println(se.getSystemModel());
            System.out.println(se.getSystemManufacturer());Edited by: emmanuel.putti on Nov 11, 2008 6:43 AM

  • How to read system eventlog using java program in windows?

    How to read system eventlog using java program in windows?
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Hi,
    There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
    The output of this command can be read using java program....
    we can use java exec for executing this system32 vbs script.
    use the below program and pass the command "eventquery"
    plz refer cscript,wscript
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec("Command");
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    input.close();
    catch (Exception err) {
    err.printStackTrace();
    This sample program will list all the system log information....
    Zoe

  • How to read system evenlog using java program in windows

    How to read system evenlog using java program in windows???
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Welcome to the Sun forums.
    >
    How to read system evenlog using java program in windows???>
    JNI. (No.)
    >
    is there any java class available to do this ? or any one having sample code for this?>You will generally get better help around here if you read the documentation, try some sample code and come back with a specific question (hopefully with an SSCCE included).
    >
    Your friend Zoe>(raised eyebrow) Thank you for sharing that with us.
    Note also that one '?' denotes a question, while 2 or more generally denotes a dweeb.

  • Stoping System Clock using Java code.

    Is it possible to do so if yes then some code idea for
    Stoping System Clock using Java code.
    [email protected]

    The system clock is controlled from the BIOS, and as such, I don't think even windoze can stop it, though it can be continually reset. I don't believe that Java provides a sufficiently low level of control to set the system clock, although you could use a native method to accomplish the task.
    Why would you want to do such a thing?

  • Set system classpath using java program??

    Hi,
    I want to set the System classpath using java program. Can somebody please tell how to do this.
    Prashant

    but this will set the classpath for that particular JVM only.
    Isn't it??? I want that of SYSTEM so that user can access that class path from any JVM instance.
    Prashant

  • System id using java

    how to get system id using java ,also MAC address?

    I think you have to use JNI and write the native calls on whatever platform(s) you need this.

  • How to invoke Default printer of my system by using java application

    I need to invoke default printer of my system by using java application ? could u plz help me out with sample code?

    VoodooMagic.getDefaultPrinter().print();
    http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-print.html
    Look for more at Google.

  • How can i get system variable using java

    Hi,
    I just want to know how can i get system variables using java code.
    for example i want to get the the date for today or i want to get the number of processes that's running.
    Thanks alot

    Hi,
    I just want to know how can i get system variables
    using java code.
    for example i want to get the the date for today or i
    want to get the number of processes that's running.
    Thanks alotSome generic "system variables" are available though Java, usually through the System class.
    Date today = new Date();
    is instantiated with the current date and time.
    Other system values, like environment values, should be passed to java through the command line (-D option) by setting system properties.
    Finally, platform specific values like the number of processes running will have to be written in platform specific code and executed by JNI (java native interface).
    Java is platform or system agnostic. Common system values, like time, are implemented. Hopefully you won't need platform specific values.

  • Can i change system time using java

    hi guys can i change system time using java iam doing one app in that i have to change the system time (my os is windowsXP) please tell me how to change the time

    What does this have to do with Swing?
    Well, there is no Java API that I'm aware of.
    However you can execute any Windows command by using the Runtime class. So you should be able to invoke the Time command.
    Search the Java Programming forum. There are plenty of examples on using the Runtime.exec(...) command.

  • Updating system registries using java

    Hi,
    I�m writing a java installer for one of our tool. In that process, I want to update the �path� and �classpath� system variables. I know I have to update the system registry. But I don�t know how to do it using java.
    Can u tell me how to do it. And can u throw me more light on this.

    Hi
    I don't have much experiance with this...but one suggestion is...
    Registry changes are configured in files name Administrative (ADM) templates. You can update that file and the automatic registry mechanism will update it automatically for you.... for more help u can go to...
    http://www.windowsecurity.com/articles/Pushing-Out-Security-Settings-Configured-Registry.html
    hope it would be useful to u..

  • Running System Commands using Java

    HI,
    I am developing an application using java which requires some system commands to be run.For example i have to write a java function which can program the windows scheduler to run a particular executable at some time & another one to initiate an ftp.I however do not know how to execute the corresponding commands from java.Is there any way or some specific api(similar to the system command in c) that i can use to perform these operations.I am using j2sdk 1.4.0_01 on a win 98 machine to develop the application.

    See [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html]java.lang.Runtime

  • Access System Resources using Java Applet via Java Script

    Hello
    I can access my Applet public methods (and this methods access system resources) via Java Script if I do the following: System.setSecurityManager(null);However, I'm making this post because I don't like this solution.
    Supposedly, setting the SM to null is like making the Applet (which is signed and was accepted by the user via a prompt from the browser) behave like a normal Java program that has no restrictions. (http://java.sun.com/docs/books/tutorial/essential/environment/security.html, second paragraph)
    However, this feels like a workaround of something that is supposed to be there (the SM).
    Also, if I make the methods invocation from inside the applet (using swing buttons and textboxes for example) I can use the standard SM without no problems.
    From my readings, the problem regarding Java Script invocation, comes from the fact that the Java Script is not a secure (not signed) source (because you can invoke public methods the way you wish from it i guess) on the contrary to the applet methods invoked by the buttons.
    Possible solutions I found in the web range from using the public static Object doPrivileged(PrivilegedAction action) method or imaginative things like creating new threads on the public method that call the private methods that access the system resources (supposedly because the new thread runs under the safe environment of the applet)
    I almost got a glimpse of hope with this post http://forums.sun.com/thread.jspa?threadID=5325271&tstart=0
    However, none of these solutions worked, the only results were with the setResourceManager(null)So, any one can contribute with a solution for this? Should I keep trying to find a solution other then the one I already have?
    Regards
    Cad

    1. yes
    2. yes
    Note for 2. the converter will run the applet with SUN jre for sure if the user has IE.
    IE will use the ActiveX technology to run the applet (as with Macromedia Flash).
    For Netscape I am not sure, but I would think Netsape will use the plug in provided by
    SUN.
    Note for SUN jre 1.3. If this applet is to be used within a company that uses a proxy with
    ntlm authentication the 1.3 applet cannot connect (to the Internet) through this proxy since
    ntlm athentication is supported since j2re1.4.2_03. There is one version before that but
    that one will pop up a window asking for the user's domain account and password wich
    is both lame and crappy.
    As for the IE settings, IE has a default setting that askes users the "do you trust"
    queston for AciveX controls within the Internet securety zone (tools -> internet options
    -> security).
    Sincy anybody can make ActiveX controls (allso sign them) a user that has a problem
    to find the "no" button will sooner or later install a malicuous ActiveX control (spy ware
    or a virus).
    If this user's desktop is within your company's network it will cause serious harm.
    This is why most company's disable this by changing the default internet expolorer
    settings. Since I assume you are writhing this applet to be used by a company I allso
    assumed that company has someone to maintain the desktops. In that case I
    assume that person would want to control the security within the SUN jre instead of
    letting the user deside what to trust and what not.

  • System Beep using Java

    I want to get system beep sound using java
    System.out.println("\007");using I can play it. but I 'm using Eclipse IDE. There that is not work. I think i want to write shell java programm and there I want to run some C code. But I don't knoww it properly.
    if aany one can do that . help me.
    thank you....

    Problem is I can't play system beep in any IDE. that mean java.awt.Toolkit.getDefaultToolkit().beep(); is not work in Eclipse IDE.
    may i can do it like this?
    Runtime r = Runtime.getRuntime(); //get runtime information
                 try
                 Process Child = r.exec("cmd.exe") ; //execute command
                 BufferedWriter outCommand = new BufferedWriter(new OutputStreamWriter(Child.getOutputStream()));
                 outCommand.write("cmd.exe");
                 outCommand.flush();
                 catch(IOException eds)
                 { //handle exec failure
                 System.out.println("ERROR: exec failure"+eds);
                 //System.exit(11); //exit application with exit code 11
                 }

  • Alerting user every 5 mins from system speaker using java script

    Hi Friends,
    I want to alert the user for every 5 mins from system speaker itself using Java Script.
    Please anybody can help me...
    Thanks and Regards
    Vijay Anand

    Java != JavaScriptYou are not asking in the appropriate forum. Go search the web for a JavaScript forum.

Maybe you are looking for