0

I'm trying to make a program that can send an email to a gmail account and I ran into an error:

Access restriction: The constructor 'Provider()' is not API (restriction on required library 'C:\Program Files\Java\jre1.8.0_45\lib\jsse.jar')

i'm not sure what it means but i have the jsse.jar file in the correct location.

here is my code:

http://pastebin.com/2Hb6jA2w

Anu
  • 13
  • 4
  • Possible duplicate of [Access restriction: The constructor Provider() is not accessible due to restriction on required library jdk1.6.0\jre\lib\jsse.jar?](http://stackoverflow.com/questions/9052391/access-restriction-the-constructor-provider-is-not-accessible-due-to-restrict). – tnw Jul 01 '15 at 17:41

1 Answers1

0

Most likely the problem is on the access rules of your JRE configuration. Open the project properties (right click on the project and then click the most bottom menu ) then :

  1. go to Java Build Path menu
  2. click the Libraries tab.
  3. expand the JRE System Library and you see there is an access rule item. then, click the Edit button
  4. Just remove all if there is no rule you actually need to reinforce.
  5. then click Ok button. then try build the project again.
kucing_terbang
  • 4,991
  • 2
  • 22
  • 28