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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:46:33+00:00 2026-05-24T22:46:33+00:00

I have a jar file which has two class files per java file. Java:

  • 0

I have a jar file which has two class files per java file.

Java:

Foo.java
Bar.java

Classfile:

Foo.class
Foo.class
Bar.class
Bar.class

I have verified that there is only one java files per class. The java files do not any contain inner classes.
I am using the ant jar-task to create the jar file. Before I execute the task, there is only one class file per class in the build directory.

I see the double class files with jar -tf jarfile.jar or when I view it in a zip program. When I unpack the files, the zip program asks if it should overwrite the existing file.

How can this happen?

  • 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-24T22:46:35+00:00Added an answer on May 24, 2026 at 10:46 pm

    I think I found the problem. This is the jar task:

        <jar basedir="${build.class.dir}" jarfile="${dist.dir}/${subproject}.jar">
            <fileset dir="${build.class.dir}" />
        </jar>
    

    As I read in the Ant website

    This task forms an implicit FileSet and supports most attributes of (dir becomes >basedir) as well as the nested , and elements.

    So it would seem that either the tag or basedir is uneccessary. At least it works.fine if I comment out the fileset tag.

    Thanks for your help and pointers!

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

Sidebar

Related Questions

I have a jar file of my application which has more than one class.
I have a jar file that has a file named client.ts in (when viewing
I have a jar file that uses some txt files. In order to get
That is when you have any jar file attached to you your class path.
I have a java JAR file that is triggered by a SQL server job.
I have a .jar file which has a command line interface. I want to
I have an application which has a font stored within a jar file. It
I have a JAR file which may be called manually or by Java Web
I have a shell script that calls a java jar file and runs an
I have an html file which has a jar file included in it as

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.