← Back to list

How to Fix ‘Not provider of jakarta.mail.util.StreamProvider was found’

Jakarta Mail (formerly JavaMail) — troubleshooting technique.

Rakshit Shah in BeingCoders · 2023-12-19 07:39 · 2,229 claps · 3.3 min read paywalled
#java #java-mail-api #tech #how-to #java-mail-library
Open on Medium ↗
Wiki topics: 📚 · Books & Reading

‘No Provider of jakarta.mail.util.StreamProvider Found’ Error — [Fixed 2025]

Learn how to resolve the ‘No provider of jakarta.mail.util.StreamProvider was found’ error in Java with clear troubleshooting steps and solutions.

Photo by Tracy Adams on Unsplash

Photo by Tracy Adams on Unsplash

The error message *“Not provider of Jakarta.mail.util.StreamProvider was found”* Typically occurs when there is an issue with the email library configuration. This error commonly arises when using Jakarta Mail (formerly JavaMail) to send emails in a Java application. This error usually occurs when there are issues with the configuration of the library used for sending emails. Let’s check it out,

Read using non-member link

Take a look at the following few steps to rectify this error:

  1. First of all, check if you added the correct required dependencies to your working project, either in your classpath or in your Pom file. If you are using the Maven file approach, check your project’s pom.xml file, make sure you have the following dependency:
<dependency>    
    <groupId>com.sun.mail</groupId>    
    <artifactId>jakarta.mail</artifactId>    
    <version>2.0.1</version> 
</dependency>

If you are using gradle then the syntax should be like,

// https://mvnrepository.com/artifact/com.sun.mail/jakarta.mail
implementation group: 'com.sun.mail', name: 'jakarta.mail', version: '2.0.1'
  1. Also make sure there is no other conflicting email libraries or multiple versions of the same library in your project. In such a case where these conflicts are happening can result into issues and errors like the one you faced.

  2. You must Clean and build or rebuild your project whether it is made with Maven or Gradle (Check step 1 for the dependencies snippet) — For IDEs like IntelliJ or Eclipse, they have an easy-to-use clean and rebuild feature. On some occasions, doing a clean build on a project could resolve issues for instance all dependencies being correctly resolved and ensuring a proper classpath is set up to deliver emails based upon your configurations. If you are using gradle in intelliJ, then reload gradle should also work.

  3. You can also confirm that while running any application this Jakarta Mail library exists within its classpath after checking both classpath and runtime environment (e.g. Tomcat, Jetty, Weblogic Server).

If you are utilizing automation in form of app servers or containers for application deployments, ensure proper deployment and accessibility of Jakarta Mail library to your applications.

  1. Do not forget to check the Packaging and deployment checks should not be forgotten at any cost. Ensure that you have all the necessary libraries included in your .war or .jar file, resources required by Jakarta Mail before deploying the application framework such as Jenkins, Bamboo or other CI/CD Pipelines.

You know you can make your own self-hosted SMTP server; read this article.

Another Possible Solution for jakarta.mail error in Java:

This Artifact Jakarta Mail is a way to make email related things work in our programs. Jakarta Mail API is like a helper that we use when writing our code

We only need it when we are writing our program, not when we are using it. So, we use the link above to download jakarta.mail.jar and remove jakarta.mail-api.jar if you have any added in your project / classpath. Then, we can add the **jakarta.mail.jar** to our program build path.

Another Possible Problem: If you are using an older version as shown below, use the above dependency mentioned in step 1: It will fix the issue,

<dependency>            
      <groupId>jakarta.mail</groupId>            
      <artifactId>jakarta.mail-api</artifactId>            
      <version>2.1.1</version>            
      <scope>provided</scope>        
</dependency>        
      <!-- github.com/eclipse-ee4j/angus-mail -->        
<dependency>
       <groupId>org.eclipse.angus</groupId>
       <artifactId>jakarta.mail</artifactId>
       <version>1.0.0</version>        
</dependency>

By following these steps, you should be able to resolve the “Not provider of Jakarta.mail.util.StreamProvider was found” error. Make sure to review your project configuration, dependencies, and runtime environment to ensure everything is set up correctly for Jakarta Mail.

You may also like to check with,

[embed]Resolving Multiple Versions of JavaMail JAR Causing NoSuchProviderException Learn the causes, troubleshooting steps, and multiple solutions to resolve JavaMail NoSuchProviderException due to…www.9mood.com

[embed]How to Fix java.lang.NoClassDefFoundError: javax/mail/MessagingException in Java Causes, Reasons, and Multiple Troubleshooting Steps to Resolve the javax.mail.MessagingException Errorwww.9mood.com

Other Interesting Articles:

Find Java Version From Compiled Class Files

Learn how to easily identify the Java version from compiled class files using the “Javap” tool.

[embed]Find Java Version From Compiled Class Files Learn how to easily identify the Java version from compiled class files using the “Javap” tool.medium.com

Unsaved Changes Prompt in JSP Forms Guide

Implementing Unsaved Changes Prompt in JSP Forms for a Seamless and Secure Web Experience.

[embed]Unsaved Changes Prompt in JSP Forms Guide Implementing Unsaved Changes Prompt in JSP Forms for a Seamless and Secure Web Experiencemedium.com

Originally published on **Not provider of jakarta.mail.util… was found — 9Mood**.

Feel free to share your thoughts below in the comment section about the Jakarta Mail Library error. I am happy to resolve your queries for free.

BeingCoders Publication

👏 Before you leave, appreciate the Author’s Effort by clapping on their story👨‍💼 Follow the Author to hear back more from him/her 📰 Knowledge shared | knowledge multiplied 🚀 , follow **BeingCoders Publication. ✍ Write some feedback or your opinion about the story. ✌ Follow us on [Facebook](https://www.facebook.com/9MoodOfficial/) | Twitter | Instagram. **Read More content at Beingcoders.


메타데이터
post_id
2064a44bc8a2
slug
how-to-fix-not-provider-of-jakarta-mail-util-streamprovider-was-found-2064a44bc8a2
url
https://medium.com/beingcoders/how-to-fix-not-provider-of-jakarta-mail-util-streamprovider-was-found-2064a44bc8a2
canonical_url
https://medium.com/beingcoders/how-to-fix-not-provider-of-jakarta-mail-util-streamprovider-was-found-2064a44bc8a2
author_url
https://medium.com/@thundersoul
status
ok
fetched_at
2026-08-28 04:09:01