JRE Emulation Reference

J2ObjC includes a library that emulates a subset of the Java runtime library (lib/libjre_emul.a). The list below shows the set of JRE packages, types and methods that J2ObjC can translate automatically. Note that in some cases, only a subset of methods is supported for a given type; if so, the supported methods are listed below the class name.

NOTE: the JRE emulation support is rapidly evolving, so this page may lag behind the actual release contents. To find the exact list of classes and methods, check the J2ObjC distribution's include directory. Each supported class will have a matching header (.h) file, which lists all supported methods.

java.beans

IndexedPropertyChangeEventPropertyChangeEventPropertyChangeListenerPropertyChangeListenerProxy
PropertyChangeSupport

java.io

BufferedInputStreamBufferedOutputStreamBufferedReaderBufferedWriter
ByteArrayInputStreamByteArrayOutputStreamCharArrayReaderCharArrayWriter
CharConversionExceptionCloseableDataInputDataInputStream
DataOutputDataOutputStreamEOFExceptionExternalizable
FileFileDescriptorFileFilterFileInputStream
FileNotFoundExceptionFileOutputStreamFileReaderFileWriter
FilenameFilterFilterInputStreamFilterOutputStreamFilterReader
FilterWriterFlushableIOExceptionInputStream
InputStreamReaderInterruptedIOExceptionInvalidClassExceptionInvalidObjectException
LineNumberReaderNotActiveExceptionNotSerializeableExceptionObjectInput
ObjectInputStreamObjectInputValidationObjectOutputObjectOutputStream
ObjectStreamClassObjectStreamConstantsObjectStreamExceptionObjectStreamField
OptionalDataExceptionOutputStreamOutputStreamWriterPipedInputStream
PipedOutputStreamPipedReaderPipedWriterPrintStream
PrintWriterPushbackInputStreamPushbackReaderRandomAccessFile
ReaderSequenceInputStreamSerializableSerializablePermission
StreamCorruptedExceptionStreamTokenizerStringReaderStringWriter
SyncFailedExceptionUTFDataFormatExceptionUnsupportedEncodingExceptionWriteAbortedException
Writer

java.lang

Void
AbstractMethodErrorAppendableArithmeticExceptionArrayIndexOutOfBoundsException
ArrayStoreExceptionAssertionErrorAutoCloseableBoolean
ByteCharSequenceCharacterClass
ClassCastExceptionClassFormatErrorClassLoaderClassNotFoundException
CloneNotSupportedExceptionComparableDeprecatedDouble
EnumErrorExceptionExceptionInInitializerError
FloatIllegalAccessExceptionIllegalArgumentExceptionIllegalMonitorState
IllegalStateExceptionIllegalThreadStateExceptionIncompatibleClassChangeErrorIndexOutOfBoundsException
InstantiationExceptionIntegerInternalErrorInterruptedException
IterableLinkageErrorLongMath
NegativeArraySizeExceptionNoSuchFieldErrorNoSuchFieldExceptionNoSuchMethodError
NoSuchMethodExceptionNullPointerExceptionNumberNumberFormatException
ObjectOverridePackageReadable
RunnableRuntimeExceptionSafeArgsSecurityException
SecurityManagerShortStackTraceElementStrictMath
StringStringBufferStringBuilderStringIndexOutOfBoundsException
SuppressWarningsSystemThreadThreadDeath
ThreadGroupThreadLocalThrowableTypeNotPresentException
UnsupportedOperationExceptionVirtualMachineError
  • System:
  • Supported methods: currentTimeMillis(), identityHashCode(), arrancopy(), nanoTime(), exit()
  • System properties: only os.name, file.separator, line.separator, path.separator (plus any defined using System.setProperty())
  • Object, Number, and String are supported but do not have header (.h) files, because these classes are translated directly to their respective Foundation classes (NSObject, NSNumber, and NSString). Class is supported by J2ObjC's IOSClass.

java.lang.annotation

AnnotationAnnotationFormatErrorAnnotationTypeMismatchExceptionDocumented
ElementTypeIncompleteAnnotationExceptionInheritedRetention
RetentionPolicyTarget

java.lang.ref

PhantomReferenceReferenceReferenceQueueSoftReference
WeakReference

java.lang.reflect

AccessibleObjectAnnotatedElementArrayConstructor
ExecutableMemberFieldGenericArrayTypeGenericDeclaration
GenericSignatureFormatErrorInvocationHandlerInvocationTargetExceptionMalformedParameterizedTypeException
MemberMethodModifierParameterizedType
ProxyReflectPermissionTypeTypeVariable
UndeclaredThrowableExceptionWildcardType

java.math

BigDecimalBigIntegerBitLevelConversion
DivisionElementaryLogicalMathContext
MultiplicationPrimalityRoundingMode

java.nio

BufferBufferFactoryBufferOverflowExceptionBufferUnderflowException
ByteBufferByteOrderCharArrayBufferCharBuffer
CharSequenceAdapterDoubleArrayBufferDoubleBufferFloatArrayBuffer
FloatBufferHeapByteBufferIntArrayBufferIntBuffer
InvalidMarkExceptionLongArrayBufferLongBufferReadOnlyBufferException
ReadOnlyCharArrayBufferReadOnlyDoubleArrayBufferReadOnlyFloatArrayBufferReadOnlyHeapByteBuffer
ReadOnlyIntArrayBufferReadOnlyLongArrayBufferReadOnlyShortArrayBufferReadWriteCharArrayBuffer
ReadWriteDoubleArrayBufferReadWriteFloatArrayBufferReadWriteHeapByteBufferReadWriteIntArrayBuffer
ReadWriteLongArrayBufferReadWriteShortArrayBufferShortArrayBufferShortBuffer

java.nio.charset

CharsetCodingExceptionCharsetCharsetDecoderCharsetEncoder
CharsetsCoderMalfunctionErrorCoderResultCodingErrorAction
IllegalCharsetNameExceptionMalformedInputExceptionStandardCharsetsUnmappableCharacterException
UnsupportedCharsetException

java.text

AnnotationAttributedCharacterIteratorAttributedStringCharacterIterator
ChoiceFormatCollationKeyCollatorDateFormat
DateFormatSymbolsDecimalFormatDecimalFormatSymbolsFieldPosition
FormatMessageFormatNumberFormatParseException
ParsePositionSimpleDateFormat

java.util

AbstractCollectionAbstractListAbstractMapAbstractQueue
AbstractSequentialListAbstractSetArrayDequeArrayList
ArraysBitSetCalendarCollection
CollectionsComparatorConcurrentModificationExceptionCurrency
DateDequeDictionaryDuplicateFormatFlagsException
EventListenerEmptyStackExceptionEnumMapEnumSet
EnumerationEventListenerEventListenerProxyEventObject
GregorianCalendarHashMapHashSetHashtable
IdentityHashMapIllegalFormatCodePointExceptionIllegalFormatConversionExceptionIllegalFormatException
IllegalFormatFlagsExceptionIllegalFormatPrecisionExceptionIllegalFormatWidthExceptionInputMismatchException
InputMismatchExceptionInvalidPropertiesFormatExceptionIteratorLinkedHashMap
LinkedHashSetLinkedListListListIterator
ListResourceBundleLocaleMapMissingFormatArgumentException
MissingFormatWidthExceptionMissingResourceExceptionNavigableMapNavigableSet
NoSuchElementExceptionObservableObserverPriorityQueue
PropertiesPropertyResourceBundleQueueRandom
RandomAccessResourceBundleServiceConfigurationErrorServiceLoader
SetSimpleTimeZoneSortedMapSortedSet
StackTimeZoneTimerTimerTask
TreeMapTreeSetUUIDUnknownFormatConversionException
UnknownFormatFlagsExceptionVectorWeakHashMap

java.util.concurrent

AbstractExecutorServiceArrayBlockingQueueBlockingDequeBlockingQueue
BrokenBarrierExceptionCallableCancellationExceptionCompletionService
ConcurrentHashMapConcurrentLinkedDequeConcurrentLinkedQueueConcurrentMap
ConcurrentNavigableMapConcurrentSkipListMapConcurrentSkipListSetCopyOnWriteArrayList
CopyOnWriteArraySetCountDownLatchCyclicBarrierDelayQueue
DelayedExchangerExecutionExceptionExecutor
ExecutorCompletionServiceExecutorServiceExecutorsForkJoinPool
ForkJoinTaskForkJoinWorkerThreadFutureFutureTask
LinkedBlockingDequeLinkedBlockingQueueLinkedTransferQueuePhaser
PriorityBlockingQueueRecursiveActionRecursiveTaskRejectedExecutionException
RejectedExecutionHandlerRunnableFutureRunnableScheduledFutureScheduledExecutorService
ScheduledFutureScheduledThreadPoolExecutorSemaphoreSynchronousQueue
ThreadFactoryThreadLocalRandomThreadPoolExecutorTimeUnit
TimeoutExceptionTransferQueue

java.util.concurrent.atomic

AtomicBooleanAtomicIntegerAtomicIntegerArrayAtomicLong
AtomicLongArrayAtomicLongFieldUpdaterAtomicMarkableReferenceAtomicReference
AtomicReferenceArrayAtomicReferenceFieldUpdaterAtomicStampedReferenceFences

java.util.concurrent.locks

AbstractOwnableSynchronizerAbstractQueuedLongSynchronizerAbstractQueuedSynchronizerCondition
LockLockSupportReadWriteLockReentrantLock
ReentrantReadWriteLock

java.util.logging

ConsoleHandlerErrorManagerFilterFormatter
HandlerLevelLogManagerLogRecord
LoggerLoggingMXBeanLoggingPermissionMemoryHandler
SimpleFormatterStreamHandlerXMLFormatter

java.util.regex

MatchResultMatcherPatternPatternSyntaxException
Splitter

javax.xml

XMLConstants

javax.xml.parsers

FactoryConfigurationErrorFilePathToURIParserConfigurationExceptionSAXParser
SAXParserFactory

javax.xml.transform

ResultSource

javax.xml.validation

SchemaTypeInfoProviderValidatorValidatorHandler

org.w3c.dom

TypeInfo

org.w3c.dom.ls

LSInputLSResourceResolver

org.xml.sax

AttributeListAttributesContentHandlerDocumentHandler
DTDHandlerEntityResolverErrorHandlerHandlerBase
InputSourceLocatorParserSAXException
SAXNotRecognizedExceptionSAXNotSupportedExceptionSAXParseExceptionXMLFilter
XMLReader

org.xml.sax.ext

Attributes2Attributes2ImplDeclHandlerDefaultHandler2
EntityResolver2LexicalHandlerLocator2Locator2Impl

org.xml.sax.helpers

AttributeListImplAttributesImplDefaultHandlerLocatorImpl
NamespaceSupportParserAdapterParserFactoryXMLFilterImpl
XMLReaderAdapterXMLReaderFactory