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 6678567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:15:32+00:00 2026-05-26T04:15:32+00:00

This concerns an attempt to run a network application. The code compiles correctly, however

  • 0

This concerns an attempt to run a network application. The code compiles correctly, however upon trying to run with “java SendMail” java returns :

C:\Butte>java SendMail
Exception in thread "main" java.lang.NoClassDefFoundError: SendMail (wrong name:
 je3/net/SendMail)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: SendMail.  Program will exit.

Is this a trivial configuration problem. I have a Java package recent enough to support other networking code. The source code is :

package je3.net;
import java.io.*;
import java.net.*;

/**
 * this software sends e-mail via a mailto : url
 */

public class SendMail {
    public static void main(String[] args) {
        // --- SNIP ----
    }
}

Thank you very much,

Joel

  • 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-05-26T04:15:32+00:00Added an answer on May 26, 2026 at 4:15 am

    Your class is in a package je3.net, so you need to run it as:

    java je3.net.SendMail
    

    However, it sounds like you probably need to compile it differently too – as that will look for je3\net\SendMail.class as a filename. Basically your source and output should match the package structure you declare.

    You don’t have to do it for the source – you could just write:

    javac -d . SendMail.java
    java je3.net.SendMail
    

    as the -d . part will make javac create the right directory structure for you. However, I’d personally move SendMail.java to a je3\net directory.

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

Sidebar

Related Questions

This question concerns XML schemas and files. Suppose I am developing a desktop application
This question concerns the reflection mechanisms of the java programming language. I have an
In Visual Studio 2008 (without SP1), I can compile and run this code //
This concerns Intellij from 9 to 11. In the IDEA window On the bottom
This concerns iPhoneOS-sdk-3.2 I am having difficulty changing the border color of a grouped
This questions concerns mostly Unix/Linux style C++ development. I see that many C++ libraries
In django, I'm trying to do something like this: # if form is valid
I am going to attempt to keep this as simple as possible, but the
This question concerns memory in Android. My method: I have two activites, A and
This question concerns generics and types as well as datatables. The following snippet is

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.