Results 1 to 7 of 7
  1. #1
    jsfgeeks is offline Member
    Join Date
    Nov 2008
    Posts
    1
    Rep Power
    0

    Question Operating System detection of client

    hi, I want to detect operating system of client machine using java is it possible?

  2. #2
    Supamagier is offline Senior Member
    Join Date
    Aug 2008
    Posts
    384
    Rep Power
    6

    Default

    It is possible, I don't know how though.
    I die a little on the inside...
    Every time I get shot.

  3. #3
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    Try looking into the code of SWT commands. Those are all very platform aware and the same GUI command will display different based on if it detects M$, Linux, Mac, etc

  4. #4
    Tamu is offline Member
    Join Date
    Nov 2008
    Posts
    19
    Rep Power
    0

    Default

    try this:
    Java Code:
    String OS = System.getProperty("os.name");
    System.out.println(OS);
    Last edited by Tamu; 11-26-2008 at 12:12 PM. Reason: for better outlook

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by Tamu View Post
    try this:
    Java Code:
    String OS = System.getProperty("os.name");
    System.out.println(OS);
    This is the way to find the OS using Java. jsfgeeks, did you try this?

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Cool ossificaton

    Java Code:
    java.lang.String osName = System.getProperty("os.name");
    // Whether we are working around Solaris.
    final boolean solarisWorkaround = (osName != null &&
    osName.indexOf("Solaris") != -1);
    Dont know what the other os's are named.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Much better,

    Java Code:
    String osName = System.getProperty("os.name");
    if(osName.startsWith("Mac OS")){
         // Do the processing
    }

Similar Threads

  1. USB Detection
    By alanixu in forum New To Java
    Replies: 3
    Last Post: 11-12-2008, 04:04 PM
  2. Collision Detection (Game)
    By mscwd in forum Sun Java Wireless Toolkit
    Replies: 0
    Last Post: 01-28-2008, 08:34 PM
  3. Accessing client file system
    By revathi17 in forum New To Java
    Replies: 1
    Last Post: 10-17-2007, 10:17 AM
  4. finding Operating System specific data
    By FrankyDee in forum New To Java
    Replies: 2
    Last Post: 09-28-2007, 03:27 PM
  5. Tracking Operating System
    By Mansi in forum Networking
    Replies: 2
    Last Post: 07-23-2007, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •