Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:25:49+00:00 2026-06-13T00:25:49+00:00

I had a problem a couple of days ago where I was getting a

  • 0

I had a problem a couple of days ago where I was getting a Permission denied: connect when using Javamail to send an e-mail using our local mail server. For reference it can be found here: JavaMail API to iMail — java.net.SocketException: Permission denied: connect. The solution was to add “-Djava.net.preferIPv4Stack=true” to my project’s VM Options.

I’m getting the same error codes after building the project and trying to run the .jar file outside of NetBeans. The project works as intended from inside the NetBeans IDE.

I have searched around the questions here, Google, and read through some Javamail FAQs. To be honest, I really don’t know what I am looking for and figure that I am just missing something.

I’m using NetBeans 7.2, Java 7, and Windows 7. The dist folder for my project has the .jar file and the dist\lib folder contains mail.jar.

Any ideas on why I would be getting that error again? Thank you again for any help/information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:25:50+00:00Added an answer on June 13, 2026 at 12:25 am

    How are you running your program?

    If you run it with “java -jar myprog.jar”, use “java -Djava.net.preferIPv4Stack=tru -jar myprog.jar”.

    If you run it by double clicking the jar file or something like that, you might need to set the property in your code, by adding System.setProperty(“java.net.preferIPv4Stack”, “true”);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A couple of days ago I had to investigate a problem where my application
I've had this really annoying problem for a couple of days, and I cannot
I had no problem at all running the following code on a local server,
I had this problem some time ago and I gave up but lately it
I asked a question a couple of days ago regarding installing numpy on the
I thought this problem had a trivial solution, couple of for loops and some
I've had a problem with NotificationManager in my app for the past couple of
I've been using Django for a couple of days & setup a basic blog
I've had this problem in a couple of ZF applications now and it's very
I've just started using SQL and had been getting by with searching google for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.