|
NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems
ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en:
http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com. |
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂtulo en concreto puede realizar una donación directa mediante Paypal:
|
To find out about the current working environment, applets can read system properties. System properties are key/value pairs that contain information such as the operating system that the applet is running under. System properties are covered in detail in the Properties page.Applets can read some, but not all, system properties.
Applets can read the following system properties:
Valid System Properties Key Meaning "file.separator"File separator (for example, "/") "java.class.version"Java class version number "java.vendor"Java vendor-specific string "java.vendor.url"Java vendor URL "java.version"Java version number "line.separator"Line separator "os.arch"Operating system architecture "os.name"Operating system name "path.separator"Path separator (for example, ":") To read a system property from within an applet, the applet uses the
Systemclass methodgetProperty. For example:The following applet reads all of the properties that are available to all applets:String newline = System.getProperty("line.separator");You can find the source code inGetOpenProperties.java.
For security reasons, no existing browsers or applet viewers let applets read the following system properties.
Forbidden System Properties Key Meaning "java.class.path"Java classpath "java.home"Java installation directory "user.dir"User's current working directory "user.home"User home directory "user.name"User account name