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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:30:16+00:00 2026-06-04T01:30:16+00:00

I am new to Java and learning how to export applications to .jar files.

  • 0

I am new to Java and learning how to export applications to .jar files. I made a simple Java application in Eclipse with a few classes based on the tutorial from Eclipse and Java for Total Beginners.

When I run my application via Run -> Run in Eclipse, my application runs without exceptions. However, when I got to File -> Export and export my application into a .jar file and then execute

java myLibrary.jar

in my Mac terminal, I get this output from standard error.

Exception in thread "main" java.lang.NoClassDefFoundError: myLibrary/jar

Caused by: java.lang.ClassNotFoundException: myLibrary.jar
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

What does this mean? How am I missing classes? I tried checking and unchecking items to export. For instance, I tried including my JUnit tests to no avail.

  • 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-04T01:30:17+00:00Added an answer on June 4, 2026 at 1:30 am

    In the terminal go to the directory that contains all your class files.

    jar cmf MANIFEST.MF myLibrary.jar *
    

    Then if the jar is created successfully you can run it by:

    java -jar myLibrary.jar
    

    The MANIFEST.MF file should contain at the very least:

    Main-Class: myLibrary
    

    Where myLibrary is the class that contains your main function.

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

Sidebar

Related Questions

Eclipse and MyEclipse create new Java files with an extra blank line after the
I'm learning java and I have made simple program that simply reads value from
I'm pretty new to java and really enjoying learning about it. I have made
I'm learning java and I'm trying to make a very simple application that does
When creating a new Java project in IntelliJ IDEA, the following directories and files
I've downloaded the JAVA Eclipse IDE and started learning Java. I have a good
I am new to java servlets. I learning from the basic. I have a
I am new at Java. I am learning. I am trying to do the
I am new to programming. I am learning Java now, there is something I
I'm new in Java and learning Java ME development. I got stuck in this

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.