Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use java.lang.System to get <strong><em>basic</em></strong> information about the system your code is running on. Not sure if you want something more detailed than that.</p> <pre><code>System.out.println(System.getProperty("os.name")); System.out.println(System.getProperty("os.arch")); System.out.println(System.getProperty("os.version")); </code></pre> <p>Properties available via java.lang.System.getProperties() are listed <a href="http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#getProperties%28%29" rel="nofollow noreferrer">here</a>.</p> <p><strong>Edit:</strong></p> <p>The system properties for <em>os.name</em>, <em>os.arch</em> and <em>os.version</em> are not garaunteed to give you useful information. It depends highly on the platform and JVM you are using. If you want an analogy you can think of it as being roughly as useful as the user agent property property sent in HTTP requests (so, barely useful). There are some third party tools you can use for getting better system information, but you will have to <a href="http://www.qoppa.com/faq/signapplet.htm" rel="nofollow noreferrer">sign</a> your applet in order to get them to work, as they require permissions on the system that fall outside the <a href="http://www.securingjava.com/chapter-two/" rel="nofollow noreferrer">Applet Security Sandbox</a>. For example, <a href="http://support.hyperic.com/display/SIGAR/Home" rel="nofollow noreferrer">SIGAR by HyperInc</a> which was mentioned on <a href="https://stackoverflow.com/questions/25552/using-java-to-get-os-level-system-information">this</a> SO post.</p> <p>Finally, to get your Applet to load on your page you need to include it on the page using applet tags. Heres an example:</p> <p> </p> <p>Some more examples of applet tags are shown on <a href="http://download.oracle.com/javase/1.4.2/docs/guide/misc/applet.html" rel="nofollow noreferrer">Oracle's site</a>.</p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload