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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:19:34+00:00 2026-05-18T21:19:34+00:00

I am having trouble correctly generating a Jar for my Java implementation. I am

  • 0

I am having trouble correctly generating a Jar for my Java implementation. I am not a Java master ( Thus why I am using Make and not Ant). I didn’t think I cared about a Jar until I realized my Windows machine didn’t hava javac. Then I thought to myself “If only I had a jar”

So I hacked a few lines together in a Makefile trying

The relevant lines are

all: client server jar

client: bin bin/Job.class bin/JobQueue.class bin/Client.class bin/FileTransfer.class

server: bin bin/Job.class bin/JobQueue.class bin/Server.class bin/ServerThread.class bin/FileTransfer.class

jar: client server
    jar cfe HBNQServer Server bin/Server.class bin/Job.class bin/JobQueue.class bin/ServerThread.class bin/FileTransfer.class
    jar cfe HBNQClient Client bin/Client.class bin/Job.class bin/JobQueue.class bin/FileTransfer.class

However when I attempt to run it I get a No Class Found Exception.

$ java -jar HBNQServer
Exception in thread "main" java.lang.NoClassDefFoundError: Server
Caused by: java.lang.ClassNotFoundException: Server
    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:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

I am sure the mistake is painfully obvious to anyone more familiar with “Jaring” files.

If I left any important code out, it may be found Here

  • 1 1 Answer
  • 1 View
  • 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-18T21:19:34+00:00Added an answer on May 18, 2026 at 9:19 pm

    I believe your problem is the bin prefix. If you jar a class file, it must be in a directory identical to its fully qualified package name. For example, if you implement a com.mycompany.Server class, the corresponding path in the jar file must be com/mycompany/Server.class. In your case, everything is in the bin directory in the jar file, so it can’t find your (presumably un-package-qualified) classes. Either put all of your classes in the bin package, or jar them up without the bin prefix.

    Something like this might work:

    jar: client server
        cd bin; jar cfe ../HBNQServer Server Server.class Job.class JobQueue.class ServerThread.class FileTransfer.class
        cd bin; jar cfe ../HBNQClient Client Client.class Job.class JobQueue.class FileTransfer.class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Silverlight 4 and am having trouble correctly generating bitmaps from UIElements
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I'm having trouble using os.utime to correctly set the modification time on the mac
I am having a constant trouble with pages not rendering correctly between FF and
I'm having trouble using gsub correctly: Given this code: replace me.gsub(/replace me/, this \\0
Im having trouble trying to post data correctly using jQuery/AJAX I have the following...
I'm having trouble with refreshing a nimbus image and not sure if I'm correctly
I'm having trouble with Project Euler's problem 12. My code is correctly generating the
Hello trying to get my website to display correctly having trouble. I am using
I'm having trouble getting the following code to work correctly. Using an online IEEE-754

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.