- Java — Built-in Exceptions
- List of Java Exceptions
- Package java.lang
- Package java.util
- Package java.io
- Package java.awt
- Package java.awt.color
- Package java.awt.datatransfer
- Package java.awt.dnd
- Package java.awt.geom
- Package java.awt.image
- Package java.awt.print
- Package java.beans
- Package java.lang.annotation
- Package java.lang.instrument
- Package java.lang.invoke
- Package java.lang.module
- Package java.lang.reflect
- Package java.net
- Package java.net.http
- Package java.nio
- Package java.nio.channels
- Package java.nio.charset
- Package java.nio.file
- Package java.nio.file.attribute
- Package java.rmi
- Package java.rmi.activation
- Package java.rmi.server
- Package java.security
- Package java.security.acl
- Package java.security.cert
- Package java.security.spec
- Package java.sql
- Package java.text
- Package java.time
- Package java.time.format
- Package java.time.temporal
- Package java.time.zone
- Package java.util.concurrent
- Package java.util.jar
- Package java.util.prefs
- Package java.util.regex
- Package java.util.zip
- Package com.sun.jdi
- Package com.sun.jdi.connect
- Package com.sun.jdi.connect.spi
- Package com.sun.jdi.request
- Package com.sun.nio.sctp
- Package com.sun.tools.attach
- Package javax.annotation.processing
- Package javax.crypto
- Package javax.imageio
- Package javax.imageio.metadata
- Package javax.lang.model
- Package javax.lang.model.element
- Package javax.lang.model.type
- Package javax.management
- Package javax.management.modelmbean
- Package javax.management.monitor
- Package javax.management.openmbean
- Package javax.management.relation
- Package javax.management.remote
- Package javax.naming
- Package javax.naming.directory
- Package javax.naming.ldap
- Package javax.net.ssl
- Package javax.print
- Package javax.print.attribute
- Package javax.script
- Package javax.security.auth
- Package javax.security.auth.callback
- Package javax.security.auth.login
- Package javax.security.cert
- Package javax.security.sasl
- Package javax.smartcardio
- Package javax.sound.midi
- Package javax.sound.sampled
- Package javax.sql.rowset
- Package javax.sql.rowset.serial
- Package javax.sql.rowset.spi
- Package javax.swing
- Package javax.swing.text
- Package javax.swing.tree
- Package javax.swing.undo
- Package javax.transaction.xa
- Package javax.xml.catalog
- Package javax.xml.crypto
- Package javax.xml.crypto.dsig
- Package javax.xml.datatype
- Package javax.xml.parsers
- Package javax.xml.stream
- Package javax.xml.transform
- Package javax.xml.validation
- Package javax.xml.xpath
- Package jdk.dynalink
- Package jdk.jshell
- Package jdk.jshell.spi
- Package jdk.nashorn.api.scripting
- Package jdk.nashorn.api.tree
- Package jdk.security.jarsigner
- Package netscape.javascript
- Package org.ietf.jgss
- Package org.w3c.dom
- Package org.w3c.dom.events
- Package org.w3c.dom.ls
- Package org.w3c.dom.ranges
- Package org.w3c.dom.xpath
- Package org.xml.sax
- Comments
- Java: List of Checked & Unchecked Exceptions
- Exceptions under the parent class java.lang.Throwable
- Exception
- ReflectiveOperationException
- RuntimeException
- Track, Analyze and Manage Errors With Rollbar
Java — Built-in Exceptions
Java defines several exception classes inside the standard package java.lang.
The most general of these exceptions are subclasses of the standard type RuntimeException. Since java.lang is implicitly imported into all Java programs, most exceptions derived from RuntimeException are automatically available.
Java defines several other types of exceptions that relate to its various class libraries. Following is the list of Java Unchecked RuntimeException.
Arithmetic error, such as divide-by-zero.
ArrayIndexOutOfBoundsException
Array index is out-of-bounds.
Assignment to an array element of an incompatible type.
IllegalArgumentException
Illegal argument used to invoke a method.
IllegalMonitorStateException
Illegal monitor operation, such as waiting on an unlocked thread.
IllegalStateException
Environment or application is in incorrect state.
IllegalThreadStateException
Requested operation not compatible with the current thread state.
IndexOutOfBoundsException
Some type of index is out-of-bounds.
NegativeArraySizeException
Array created with a negative size.
Invalid use of a null reference.
NumberFormatException
Invalid conversion of a string to a numeric format.
Attempt to violate security.
StringIndexOutOfBounds
Attempt to index outside the bounds of a string.
UnsupportedOperationException
An unsupported operation was encountered.
Following is the list of Java Checked Exceptions Defined in java.lang.
ClassNotFoundException
CloneNotSupportedException
Attempt to clone an object that does not implement the Cloneable interface.
IllegalAccessException
Access to a class is denied.
InstantiationException
Attempt to create an object of an abstract class or interface.
One thread has been interrupted by another thread.
A requested field does not exist.
NoSuchMethodException
A requested method does not exist.
List of Java Exceptions
All public exceptions and errors in the Java API, grouped by package.
✔: Checked exception
: Since version
Package java.lang
- Throwable ✔
- Exception ✔
- CloneNotSupportedException ✔
- InterruptedException ✔
- ReflectiveOperationException ✔
- ClassNotFoundException ✔
- IllegalAccessException ✔
- InstantiationException ✔
- NoSuchFieldException ✔
- NoSuchMethodException ✔
- ArithmeticException
- ArrayStoreException
- ClassCastException
- EnumConstantNotPresentException
- IllegalArgumentException
- IllegalThreadStateException
- NumberFormatException
- ArrayIndexOutOfBoundsException
- StringIndexOutOfBoundsException
- AssertionError
- LinkageError
- BootstrapMethodError
- ClassCircularityError
- ClassFormatError
- UnsupportedClassVersionError
- AbstractMethodError
- IllegalAccessError
- InstantiationError
- NoSuchFieldError
- NoSuchMethodError
- InternalError
- OutOfMemoryError
- StackOverflowError
- UnknownError
Package java.util
- ServiceConfigurationError
- InvalidPropertiesFormatException ✔
- ConcurrentModificationException
- EmptyStackException
- IllegalFormatException
- DuplicateFormatFlagsException
- FormatFlagsConversionMismatchException
- IllegalFormatCodePointException
- IllegalFormatConversionException
- IllegalFormatFlagsException
- IllegalFormatPrecisionException
- IllegalFormatWidthException
- MissingFormatArgumentException
- MissingFormatWidthException
- UnknownFormatConversionException
- UnknownFormatFlagsException
- InputMismatchException
Package java.io
- IOError
- IOException ✔
- CharConversionException ✔
- EOFException ✔
- FileNotFoundException ✔
- InterruptedIOException ✔
- ObjectStreamException ✔
- InvalidClassException ✔
- InvalidObjectException ✔
- NotActiveException ✔
- NotSerializableException ✔
- OptionalDataException ✔
- StreamCorruptedException ✔
- WriteAbortedException ✔
Package java.awt
Package java.awt.color
Package java.awt.datatransfer
Package java.awt.dnd
Package java.awt.geom
Package java.awt.image
Package java.awt.print
Package java.beans
Package java.lang.annotation
Package java.lang.instrument
Package java.lang.invoke
Package java.lang.module
Package java.lang.reflect
Package java.net
Package java.net.http
Package java.nio
Package java.nio.channels
Package java.nio.charset
Package java.nio.file
Package java.nio.file.attribute
Package java.rmi
- AlreadyBoundException ✔
- RemoteException ✔
- AccessException ✔
- ConnectException ✔
- ConnectIOException ✔
- MarshalException ✔
- NoSuchObjectException ✔
- ServerError ✔
- ServerException ✔
- ServerRuntimeException ✔
- StubNotFoundException ✔
- UnexpectedException ✔
- UnknownHostException ✔
- UnmarshalException ✔
Package java.rmi.activation
Package java.rmi.server
Package java.security
Package java.security.acl
Package java.security.cert
Package java.security.spec
Package java.sql
- SQLException ✔
- BatchUpdateException ✔
- SQLClientInfoException ✔
- SQLNonTransientException ✔
- SQLDataException ✔
- SQLFeatureNotSupportedException ✔
- SQLIntegrityConstraintViolationException ✔
- SQLInvalidAuthorizationSpecException ✔
- SQLNonTransientConnectionException ✔
- SQLSyntaxErrorException ✔
- SQLTimeoutException ✔
- SQLTransactionRollbackException ✔
- SQLTransientConnectionException ✔
- DataTruncation ✔
Package java.text
Package java.time
Package java.time.format
Package java.time.temporal
Package java.time.zone
Package java.util.concurrent
Package java.util.jar
Package java.util.prefs
Package java.util.regex
Package java.util.zip
Package com.sun.jdi
- AbsentInformationException ✔
- ClassNotLoadedException ✔
- IncompatibleThreadStateException ✔
- InvalidTypeException ✔
- InvocationException ✔
- ClassNotPreparedException
- InconsistentDebugInfoException
- InternalException
- InvalidCodeIndexException
- InvalidLineNumberException
- InvalidModuleException 9
- InvalidStackFrameException
- NativeMethodException
- ObjectCollectedException
- VMCannotBeModifiedException
- VMDisconnectedException
- VMMismatchException
- VMOutOfMemoryException
Package com.sun.jdi.connect
Package com.sun.jdi.connect.spi
Package com.sun.jdi.request
Package com.sun.nio.sctp
Package com.sun.tools.attach
Package javax.annotation.processing
Package javax.crypto
Package javax.imageio
Package javax.imageio.metadata
Package javax.lang.model
Package javax.lang.model.element
Package javax.lang.model.type
Package javax.management
- BadAttributeValueExpException ✔
- BadBinaryOpValueExpException ✔
- BadStringOperationException ✔
- InvalidApplicationException ✔
- JMException ✔
- MBeanException ✔
- MBeanRegistrationException ✔
- AttributeNotFoundException ✔
- InstanceAlreadyExistsException ✔
- InstanceNotFoundException ✔
- IntrospectionException ✔
- InvalidAttributeValueException ✔
- ListenerNotFoundException ✔
- MalformedObjectNameException ✔
- NotCompliantMBeanException ✔
- ServiceNotFoundException ✔
- RuntimeErrorException
- RuntimeMBeanException
- RuntimeOperationsException
Package javax.management.modelmbean
Package javax.management.monitor
Package javax.management.openmbean
Package javax.management.relation
- RelationException ✔
- InvalidRelationIdException ✔
- InvalidRelationServiceException ✔
- InvalidRelationTypeException ✔
- InvalidRoleInfoException ✔
- InvalidRoleValueException ✔
- RelationNotFoundException ✔
- RelationServiceNotRegisteredException ✔
- RelationTypeNotFoundException ✔
- RoleInfoNotFoundException ✔
- RoleNotFoundException ✔
Package javax.management.remote
Package javax.naming
- NamingException ✔
- CannotProceedException ✔
- CommunicationException ✔
- ConfigurationException ✔
- ContextNotEmptyException ✔
- InsufficientResourcesException ✔
- InterruptedNamingException ✔
- InvalidNameException ✔
- LimitExceededException ✔
- SizeLimitExceededException ✔
- TimeLimitExceededException ✔
- LinkLoopException ✔
- MalformedLinkException ✔
- AuthenticationException ✔
- AuthenticationNotSupportedException ✔
- NoPermissionException ✔
Package javax.naming.directory
Package javax.naming.ldap
Package javax.net.ssl
Package javax.print
Package javax.print.attribute
Package javax.script
Package javax.security.auth
Package javax.security.auth.callback
Package javax.security.auth.login
Package javax.security.cert
Package javax.security.sasl
Package javax.smartcardio
Package javax.sound.midi
Package javax.sound.sampled
Package javax.sql.rowset
Package javax.sql.rowset.serial
Package javax.sql.rowset.spi
Package javax.swing
Package javax.swing.text
Package javax.swing.tree
Package javax.swing.undo
Package javax.transaction.xa
Package javax.xml.catalog
Package javax.xml.crypto
Package javax.xml.crypto.dsig
Package javax.xml.datatype
Package javax.xml.parsers
Package javax.xml.stream
Package javax.xml.transform
Package javax.xml.validation
Package javax.xml.xpath
Package jdk.dynalink
Package jdk.jshell
Package jdk.jshell.spi
Package jdk.nashorn.api.scripting
Package jdk.nashorn.api.tree
Package jdk.security.jarsigner
Package netscape.javascript
Package org.ietf.jgss
Package org.w3c.dom
Package org.w3c.dom.events
Package org.w3c.dom.ls
Package org.w3c.dom.ranges
Package org.w3c.dom.xpath
Package org.xml.sax
Comments
Java: List of Checked & Unchecked Exceptions
Like most modern programming languages, Java includes the concept of exceptions to handle both errors and «exceptional events.» When an exception occurs in your code, it disrupts the normal instruction logic and abnormally terminates the process.
However, with a little foresight and code, you can often handle these exceptions gracefully, allowing your code to continue running and providing insight for tracking down the root cause of the unexpected result.
Below we have compiled a list of Checked and UncheckedJava exceptions you would likely encounter, with links to their corresponding guide on how best to implement them.
Exceptions under the parent class java.lang.Throwable
Checked exceptions are denoted by the ✓ mark
Exception
ReflectiveOperationException
RuntimeException
IllegalArgumentException
IndexOutOfBoundsException
Track, Analyze and Manage Errors With Rollbar
Managing errors and exceptions in your code is challenging. It can make deploying production code an unnerving experience. Being able to track, analyse, and manage errors in real-time can help you proceed with more confidence. Rollbar automates error monitoring and triaging, making fixing Java errors easier than ever. Sign Up Today!
- MBeanException ✔
- Exception ✔