Java System attribute acquisition

Source: Internet
Author: User
Tags file separator
<%
// System attributes
String javaversion = system. getproperty ("Java. Version ");
String javavendor = system. getproperty ("Java. Vendor ");
String javavendorurl = system. getproperty ("Java. Vendor. url ");
String javahome = system. getproperty ("Java. Home ");
String javavmspecificationversion = system. getproperty ("Java. VM. Specification. Version ");
String javavmspecificationvendor = system. getproperty ("Java. VM. Specification. Vendor ");
String javavmspecificationname = system. getproperty ("Java. VM. Specification. Name ");
String javavmversion = system. getproperty ("Java. VM. Version ");
String javavmvendor = system. getproperty ("Java. VM. Vendor ");
String javavmname = system. getproperty ("Java. VM. Name ");
String required pecificationversion = system. getproperty ("Java. Specification. Version ");
String export pecificationvendor = system. getproperty ("Java. Specification. Vendor ");
String response pecificationname = system. getproperty ("Java. Specification. Name ");
String javaclassversion = system. getproperty ("Java. Class. Version ");
String javaclasspath = system. getproperty ("Java. Class. Path ");
String javalibrarypath = system. getproperty ("Java. Library. Path ");
String javaiotmpdir = system. getproperty ("Java. Io. tmpdir ");
String javacompiler = system. getproperty ("Java. compiler ");
String javaextdirs = system. getproperty ("Java. Ext. dirs ");
String osname = system. getproperty ("OS. Name ");
String osarch = system. getproperty ("OS. Arch ");
String osversion = system. getproperty ("OS. Version ");
String fileseparator = system. getproperty ("file. separator ");
String pathseparator = system. getproperty ("path. separator ");
String lineseparator = system. getproperty ("line. separator ");
String username = system. getproperty ("user. Name ");
String userhome = system. getproperty ("user. Home ");
String userdir = system. getproperty ("user. dir ");
%>

Java. Version: Java runtime version
Installation Directory of Java. Home Java
Java. Class. Version: version number of the Java class format
Java. Class. Path: Search Path of the Java class
Java. Io. tmpdir default temporary directory
Timely compiler used by Java. compiler Java
Java. Ext. dirs Java extension package directory
OS. NameOperating SystemName

OS. Arch Operating System Architecture
OS. Version
File. Separator file separator ('/' in UNIX '/')
Path. Separator path separator (':' in UNIX ':')
Line. Separator Line Break ('/N' in UNIX ')
User. Name User Account Name
User. Home user directory
User. dir: current working directory of the user



Test procedure
Class setting
...{
Public static void main (string [] ARGs)
...{
System. Out. println (system. getproperty ("Java. Version "));
System. Out. println (system. getproperty ("Java. Home "));
System. Out. println (system. getproperty ("Java. Class. Version "));
System. Out. println (system. getproperty ("Java. Class. Path "));
System. Out. println (system. getproperty ("Java. Io. tmpdir "));
System. Out. println (system. getproperty ("Java. compiler "));
System. Out. println (system. getproperty ("Java. Ext. dirs "));
System. Out. println (system. getproperty ("OS. Name "));
System. Out. println (system. getproperty ("OS. Arch "));
System. Out. println (system. getproperty ("OS. Version "));
System. Out. println (system. getproperty ("file. separator "));
System. Out. println (system. getproperty ("path. separator "));
System. Out. println (system. getproperty ("line. separator "));
System. Out. println (system. getproperty ("user. Name "));
System. Out. println (system. getproperty ("user. Home "));
System. Out. println (system. getproperty ("user. dir "));
}
}

 public class DefaultEditorKit
 
 
Extends editorkit

This is a text component that enables the editorTypeThe set of implementations required for the rational use of the text documentation. This implementation provides a default implementation that treats text as plain text and provides the minimum set of operations for a simple editor.

 

Line feed
Two attributes are used to process line breaks. System attributes line.separatorIt is defined as platform-independent. It can be "/N", "/R", or "/R/N ". There is also an attribute, which is in DefaultEditorKitAnd the name is EndOfLineStringPropertyIt is automatically defined during document loading and is defined as the first line break that appears. After the document is loaded, it will be set as appropriate EndOfLineStringPropertyWhen the document is written back EndOfLineStringProperty. However, when the document is in memory, no matter how the document defines the line feed on the disk, the "/N" character will be used to define the line feed. Therefore, "/N" is frequently used for search convenience ". When a new document is created EndOfLineStringPropertyWhen not defined, the system attribute is used for writing the document.

Note thatDocumentUse onget/setPropertyMethod settingsEndOfLineStringProperty. Subclass can override this behavior.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.