Java Exceptions | Generated by AI

Home PDF

Here’s an extensive list of Java exceptions, categorized into Checked Exceptions, Unchecked Exceptions (Runtime), and Errors.


1. Checked Exceptions (Must be handled or declared using throws)

  1. IOException – General I/O failure.
  2. FileNotFoundException – File is missing or inaccessible.
  3. InterruptedException – Thread interruption occurs.
  4. SQLException – Issues related to database access.
  5. ParseException – Error while parsing data formats.
  6. MalformedURLException – Invalid URL format.
  7. ClassNotFoundException – Class is not found at runtime.
  8. InstantiationException – Cannot instantiate an abstract class or interface.
  9. IllegalAccessException – Access to a class, method, or field is not allowed.
  10. NoSuchMethodException – Method does not exist.
  11. NoSuchFieldException – Field does not exist in the class.
  12. TimeoutException – A blocking operation timed out.
  13. UnsupportedEncodingException – Encoding is not supported.
  14. URISyntaxException – Invalid URI syntax.
  15. NotBoundException – Name not found in an RMI registry.
  16. AlreadyBoundException – Name already bound in an RMI registry.
  17. CloneNotSupportedException – Object does not implement Cloneable.
  18. DataFormatException – Invalid format in compressed data.
  19. EOFException – Unexpected end of file reached.
  20. NotSerializableException – Object is not serializable.
  21. LineUnavailableException – Audio line is unavailable.
  22. UnsupportedAudioFileException – Unsupported audio file format.
  23. PrinterException – Printing operation failure.
  24. ReflectiveOperationException – General reflection error.
  25. ExecutionException – Exception during concurrent task execution.
  26. ScriptException – Issues with executing scripts.
  27. TransformerException – XML transformation failure.
  28. XPathExpressionException – Invalid XPath expression.
  29. SAXException – Issues with XML parsing.
  30. JAXBException – Issues with XML binding.
  31. MarshalException – Error while marshalling XML data.
  32. UnmarshalException – Error while unmarshalling XML data.
  33. DatatypeConfigurationException – Invalid XML data type configuration.
  34. GSSException – Issues with GSS security operations.
  35. KeyStoreException – Problems with Java KeyStore.
  36. CertificateException – Problems with certificate processing.
  37. InvalidKeyException – Invalid key in cryptographic operations.
  38. NoSuchAlgorithmException – Requested cryptographic algorithm is not available.
  39. NoSuchProviderException – Requested security provider is not available.
  40. UnrecoverableKeyException – Cannot recover a key from KeyStore.
  41. IllegalBlockSizeException – Invalid block size for encryption.
  42. BadPaddingException – Padding error in cryptography.

2. Unchecked Exceptions (Runtime Exceptions)

  1. NullPointerException – Accessing an object reference that is null.
  2. ArrayIndexOutOfBoundsException – Accessing an invalid array index.
  3. StringIndexOutOfBoundsException – Accessing an invalid string index.
  4. ArithmeticException – Math errors like division by zero.
  5. NumberFormatException – Converting an invalid string to a number.
  6. ClassCastException – Invalid type casting.
  7. IllegalArgumentException – Invalid argument passed to a method.
  8. IllegalStateException – Method called at an invalid state.
  9. UnsupportedOperationException – Method is not supported.
  10. ConcurrentModificationException – Concurrent modification of a collection.
  11. NoSuchElementException – Attempting to access a non-existent element in a collection.
  12. IllegalMonitorStateException – Thread synchronization error.
  13. NegativeArraySizeException – Creating an array with a negative size.
  14. StackOverflowError – Infinite recursion leading to stack overflow.
  15. OutOfMemoryError – JVM runs out of memory.
  16. SecurityException – Security violation detected.
  17. MissingResourceException – Resource bundle not found.
  18. EmptyStackException – Attempting to access an element from an empty stack.
  19. TypeNotPresentException – Type not found at runtime.
  20. EnumConstantNotPresentException – Invalid enum constant.
  21. UncheckedIOException – Unchecked version of IOException.
  22. DateTimeException – Errors related to Java’s date-time API.
  23. InvalidClassException – Issues with deserializing a class.
  24. IllegalCharsetNameException – Invalid character set name.
  25. UnsupportedCharsetException – Charset is not supported.
  26. ProviderNotFoundException – Required service provider is missing.
  27. PatternSyntaxException – Invalid regular expression syntax.
  28. InvalidPathException – Invalid file path.
  29. ReadOnlyBufferException – Attempting to modify a read-only buffer.
  30. BufferUnderflowException – Buffer underflow occurs.
  31. BufferOverflowException – Buffer overflow occurs.
  32. FileSystemAlreadyExistsException – File system already exists.
  33. FileSystemNotFoundException – File system is not found.
  34. ClosedWatchServiceException – Watch service is closed.
  35. UncheckedExecutionException – Issues in concurrent task execution.

3. Errors (Serious issues that should not be caught)

  1. StackOverflowError – Too many recursive method calls.
  2. OutOfMemoryError – JVM runs out of memory.
  3. VirtualMachineError – Critical JVM error.
  4. InternalError – Unexpected internal JVM error.
  5. UnknownError – Unknown critical error.
  6. AssertionError – Assertion failed using assert.
  7. NoClassDefFoundError – Class definition is missing at runtime.
  8. IncompatibleClassChangeError – Incompatible changes to a class.
  9. AbstractMethodError – Abstract method is not implemented.
  10. InstantiationError – Instance creation failure.
  11. IllegalAccessError – Illegal access to a class or method.
  12. NoSuchMethodError – Method is not found.
  13. NoSuchFieldError – Field is not found.
  14. ClassFormatError – Invalid class format.
  15. UnsupportedClassVersionError – Java class compiled with an unsupported version.
  16. AnnotationFormatError – Issues with Java annotations.
  17. ExceptionInInitializerError – Exception in a static initializer block.
  18. ThreadDeath – Thread forcibly terminated.
  19. ServiceConfigurationError – Service provider configuration issue.
  20. BootstrapMethodError – Error in dynamic language support.
  21. VerifierError – Bytecode verification failure.
  22. FactoryConfigurationError – Error in XML factory configuration.

Conclusion

This is a comprehensive list of Java exceptions and errors. If you need more details on any specific exception, let me know! 🚀


Back 2025.03.27 Donate