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

  • Home
  • SEARCH
  • 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 7936771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:18:52+00:00 2026-06-03T22:18:52+00:00

My code compiles correctly in Eclipse, as well as runs. Before I added a

  • 0

My code compiles correctly in Eclipse, as well as runs. Before I added a piece of code I could also successfully make a jar file by doing:

jar cvfm Manifest.txt <Classes>

then I added this to my code in the constructor:

addWindowFocusListener(new WindowAdapter() {
public void windowGainedFocus(WindowEvent e) {
    JFrame window = (JFrame) e.getSource();
            window.toBack();
}});

When I try to create a new jar file and run it, I receive the NoClassDefError with the error line pointing to that code. To be specific, I got this:

Exception in thread "main" java.lang.NoClassDefFoundError: BinaryClock$1
at BinaryClock.<init>(BinaryClock.java:55)

BinaryClock being my main class and line 55 being the first line of the code from above. I don’t understand why it makes BinaryClock$1, then gives me the error on it.

If more code or information is needed, let me know. I didn’t want to paste my entire source code if it wasn’t needed.

  • 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-03T22:18:53+00:00Added an answer on June 3, 2026 at 10:18 pm

    The BinaryClock$1.class file will contain the anonymous inner class created for your WindowAdapter in the code you’ve shown. You should include that file in the jar file.

    Basically, you should build into a clean directory, and include everything in that directory in your jar file. Don’t try to be selective about it – if a file is being produced by the compiler, there’s a good reason for it.

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

Sidebar

Related Questions

This code compiles, and runs successfully locally, but not on another server. Both machines
The following code compiles correctly under VC++ 8 on XPSP3, but running it causes
The following source code compiles correctly with Visual Studio 2010: namespace NS { class
The following code compiles perfectly with Eclipse, but fails to compile with javac: public
Our code base conditionally compiles code based on compile-time configs. CDT plugin in Eclipse
I am now going to use the .jar file on http://code.google.com/p/google-api-translate-java/ . However, after
I am trying to package the android code into a jar file so that
I'm porting my application from 32 bit to 64 bit. Currently, the code compiles
The code compiles without too much complaint, but the last step fails with the
This code compiles fine: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators,

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.