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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:17:08+00:00 2026-05-22T16:17:08+00:00

I have just started learning how to use m2eclipse. What I am trying to

  • 0

I have just started learning how to use m2eclipse. What I am trying to do is make a very simple program (Hello, World) and turn it into an executable jar. The java code itself is:

public class Speak {

/**
 * @param args
 */
public static void main(String[] args) {
    System.out.println("Meow!");
}

}

which runs fine as a Java application. I then try to use Maven to build the program, which it does, but then when I try to run the .jar it tells me “Failed to load Main-Class attribute from …”. This is the .pom that m2eclipse generated when I started the project:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org   /2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.felines</groupId>
<artifactId>tabbies</artifactId>
<version>0.0</version>
<dependencies>
<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>2.3.1</version>
  <type>maven-plugin</type>
  <scope>compile</scope>
</dependency>
</dependencies>
</project>

I have tried modifying the .pom, like so:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.felines</groupId>
<artifactId>tabbies</artifactId>
<version>0.0</version>
<build>
<plugins>
    <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
        <archive>
        <manifest>
             <mainClass>org.felines.Speak</mainClass>
             <packageName>org.felines</packageName>
        </manifest>
            <manifestEntries>
                <mode>development</mode>
                <url>${pom.url}</url>
        </manifestEntries>
        </archive>
        </configuration>
    </plugin>
</plugins>
</build>
</project>

Now it says “Could not find the main class: org.felines.Speak. Program will exit.” Any ideas? 🙁

Thank you for your time!

  • 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-22T16:17:09+00:00Added an answer on May 22, 2026 at 4:17 pm

    In your pom.xml you state that the main class should be org.felines.Speak. But the class is actually in the default package, meaning no package definition. So either set the package to org.felines in the class implementation or change your mainClass entry in the pom.xml to Speak alone. Then the necessary information to start the jar should be available.

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

Sidebar

Related Questions

I have just started learning Erlang and am trying out some Project Euler problems
I have just started learning Lucene and would like to use it for indexing
I have just started learning GWT. My question is pretty simple: If I create
I have just started learning UML and after completing use case I've just started
I just started learning Objective-C and OOP ... so I have very stupid question
Hi I have just started learning about xsd as I want to use it
I have just started to work on web applications, and learning to use ASP.Net.
Hi Just started learning c for uni (usually use objective c) and have run
I've just started learning how to use the Entity Framework to write a very
I have just started learning Jquery and am new to writing javascript (I am

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.