Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/java/lang/Compiler#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/lang/Compiler#inhmethods)

# Compiler

` public final class Compiler `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.lang.Compiler |

<br />

*** ** * ** ***

Does nothing on Android.

## Summary

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Compiler#command(java.lang.Object)(https://developer.android.com/reference/java/lang/Object cmd) ` Executes an operation according to the specified command object. |
| ` static boolean` | ` https://developer.android.com/reference/java/lang/Compiler#compileClass(java.lang.Class<?>)(https://developer.android.com/reference/java/lang/Class<?> classToCompile) ` Compiles the specified class using the JIT compiler and indicates if compilation has been successful. |
| ` static boolean` | ` https://developer.android.com/reference/java/lang/Compiler#compileClasses(java.lang.String)(https://developer.android.com/reference/java/lang/String nameRoot) ` Compiles all classes whose name matches the specified name using the JIT compiler and indicates if compilation has been successful. |
| ` static void` | ` https://developer.android.com/reference/java/lang/Compiler#disable()() ` Disables the JIT compiler. |
| ` static void` | ` https://developer.android.com/reference/java/lang/Compiler#enable()() ` Enables the JIT compiler. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### command

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Object command (Object cmd)
```

Executes an operation according to the specified command object. This method is the low-level interface to the JIT compiler. It may return any object or `null` if no JIT compiler is available. Returns null on Android, whether or not the system has a JIT.

<br />

| Parameters ||
|---|---|
| `cmd` | `Object`: the command object for the JIT compiler. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | the result of executing command or `null`. <br /> |

### compileClass

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean compileClass (Class<?> classToCompile)
```

Compiles the specified class using the JIT compiler and indicates if compilation has been successful. Does nothing and returns false on Android.

<br />

| Parameters ||
|---|---|
| `classToCompile` | `Class`: java.lang.Class the class to JIT compile <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the compilation has been successful; `false` if it has failed or if there is no JIT compiler available. <br /> |

### compileClasses

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean compileClasses (String nameRoot)
```

Compiles all classes whose name matches the specified name using the JIT compiler and indicates if compilation has been successful. Does nothing and returns false on Android.

<br />

| Parameters ||
|---|---|
| `nameRoot` | `String`: the string to match class names with. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the compilation has been successful; `false` if it has failed or if there is no JIT compiler available. <br /> |

### disable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void disable ()
```

Disables the JIT compiler. Does nothing on Android.

<br />

### enable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void enable ()
```

Enables the JIT compiler. Does nothing on Android.

<br />