J2SE Language classes for MID Profile

MID Profile Language Classes included from Java 2 Standard Edition. In addition to the `java.lang` classes specified in the Connected Limited Device Configuration the Mobile Information Device Profile includes the following class from Java 2 Standard Edition.

- java.lang.IllegalStateException.java

`IllegalStateException`s are thrown when illegal transitions are requested, such as scheduling a `TimerTask` or in the containment of user interface components.

## System Functions

The MIDP is based on the Connected, Limited Device Configuration (CLDC). Some features of the CLDC are modified or extended by the MIDP.

## System Properties

The MIDP defines the following property values (in addition to those defined in the CLDC specification) that MUST be made available to the application using `java.lang.System.getProperty` :

###### System Properties Defined by MIDP

System Property | Description
--- | ---
`microedition.locale` | The current locale of the device, may be `null`
`microedition.profiles` | is a blank (Unicode U+0020) separated list of the J2ME profiles that this device supports. For MIDP devices, this property MUST contain at least "MIDP-2.0"

Other properties may be available from other profiles or the implementation.

Property microedition.locale

The locale property, if not `null`, MUST consist of the language and MAY optionally also contain the country code, and variant separated by "-" (Unicode U+002D). For example, "fr-FR" or "en-US." (Note: the MIDP 1.0 specification used the HTTP formatting of language tags as defined in RFC3066 Tags for the Identification of Languages. This is different from the J2SE definition for `Locale` printed strings where fields are separated by "_" (Unicode U+005F). )

The language codes MUST be the lower-case, two-letter codes as defined by ISO-639.

The country code MUST be the upper-case, two-letter codes as defined by ISO-3166.

## Application Resource Files

Application resource files are accessed using `getResourceAsStream(String name)` in `java.lang.Class` . In the MIDP specification, `getResourceAsStream` is used to allow resource files to be retrieved from the MIDlet Suite's JAR file.

Resource names refer to the contents of the MIDlet Suite JAR file. Absolute pathnames, beginning with "/" are fully qualified file names within the jar file.

Relative pathnames, not beginning with "/" are relative to the class upon which `getResourceAsStream` is called. Relative names are converted to absolute by prepending a "/" followed by the fully qualified package with "." characters converted to "/" and a separator of "/". The resulting string is reduced to canonical form by applying as many times as possible the following:

- All occurrences of "/./" are replaced with "/".
- All occurrences of "/segment/../" are replaced with "/" where segment does not contain "/".

The canonical resource name is the absolute pathname of the resource within the JAR.

In no case can the path extend outside the JAR file, and resources outside the JAR file MUST NOT be accessible. For example, using "../../" does NOT point outside the JAR file. If there are any remaining "." or ".." characters they are treated literally in locating the resource. No resource can exist with that name so `null` is returned from `Class.getResourceAsStream`. Also, devices MUST NOT allow classfiles to be read from the JAR file as resources, but all other files MUST be accessible.

## System.exit

The behavior of `java.lang.System.exit` MUST throw a `java.lang.SecurityException` when invoked by a MIDlet. The only way a MIDlet can indicate that it is complete is by calling `MIDlet.notifyDestroyed` .

## Runtime.exit

The behavior of `java.lang.Runtime.exit` MUST throw a `java.lang.SecurityException` when invoked by a MIDlet. The only way a MIDlet can indicate that it is complete is by calling `MIDlet.notifyDestroyed` .

@since MIDP 1.0