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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:57:06+00:00 2026-06-18T03:57:06+00:00

i created an ant build for my project. I saw some different class names

  • 0

i created an ant build for my project.
I saw some different class names when extracted the jar file like myfile.class(r).
and the size of this class file is not same as that of the compiled class files.
Why is this happening.
When i run the jar i got Exception that can not find the method.
But the jar i exported form eclipse working prfectly.

here is my build.xml file

<path id="master-classpath">
    <fileset dir="${lib.dir}">
        <include name="*.jar"/>
    </fileset>

</path>

<manifestclasspath property="lib.list" jarfile=".">
        <classpath refid="master-classpath" />
</manifestclasspath>

<target name="clean" description="Clean output directories">
        <delete dir="${build.dir}"/>
</target>


<target name="build" description="Compile source tree java files">
        <echo>copy src files</echo>
        <mkdir dir="${copy.dir}"/>
        <copy todir="${copy.dir}">
                <fileset dir="${src.dir}">
                    <exclude name="**/*.class"/>
                    <include name="**/*.java"/>
                    <include name="**/*.properties"/>
                    <include name="**/*.MIB"/>
                    <include name="**/*.java.bak"/>

                </fileset>        
        </copy>


    <echo>Compiling the source code</echo>
    <echo>Apache Ant java version is ${ant.java.version}</echo>
    <mkdir dir="${build.dir}"/>
    <javac destdir="${build.dir}" srcdir="${copy.dir}" source="1.6" target="1.6" debug="on">

        <classpath refid="master-classpath"/>
    </javac>
    <copy todir="${build.dir}">
        <fileset dir="${src.dir}/src">
            <exclude name="**/*.java"/>
            <exclude name="**/*.class"/>
            <include name="**/*.properties"/>
            <include name="**/*.MIB"/>
        </fileset>        
    </copy>  
</target>

<target name="jar" depends="build">



    <mkdir dir="${jar.dir}"/>
    <echo>building jar!</echo>


    <jar destfile="${jar.dir}/${ant.project.name}.jar" >



        <fileset dir="${build.dir}" >
                <include name="**/*.class" />
                <include name="**/*.properties" />
                <include name="**/*.MIB" />
                <include name="**/*.java.bak"/>
                <include name="**/*.png"/>
                <include name="**/*.jpg"/>
        </fileset>


        <zipfileset includes="**/**.**" src="${lib.dir}/junit.jar"/>
        <zipfileset includes="**/*.*" src="${lib.dir}/mysql-connector-java-5.0.8-bin.jar"/>
        <zipfileset includes="**/*.*" src="${lib.dir}/NicManager.jar"/>
        <zipfileset includes="**/**.**" src="${lib.dir}/log4j-1.2.14.jar"/>
        <zipfileset includes="**/*.*" src="${lib.dir}/snmp4j-1.11.3.jar"/>
        <zipfileset includes="**/*.*" src="${lib.dir}/snmp4j-agent-1.4.3.jar"/>
        <zipfileset includes="**/*.*" src="${lib.dir}/NMSLookAndFeel.jar"/>
        <zipfileset includes="**/*.*" src="${lib.dir}/rt.jar"/>   
        <manifest>
            <attribute name="Main-Class" value="com.ushustech.nmsazzist.NMSAzzistApp" />
            <attribute name="Class-Path" value="${lib.list}"/>
        </manifest>

    </jar>
</target>
<target name="main" depends="clean,jar"/>

  • 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-18T03:57:08+00:00Added an answer on June 18, 2026 at 3:57 am

    i found the problem after some days. it’s because of a duplicate jar file which also contains the classes that are in my project. those classes were look like myfile.class(r).

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

Sidebar

Related Questions

I created a new project in eclipse using an existing ant build file (using
I'd like to associate some ANT targets with my project's build in Eclipse. No
I've created a Java project from existing source with an Ant build script in
I created a Java library with an ant file to build it into a
I am having a java project with a ant build file, using this ant
I tried to create a jar file from a java project, which uses some
I have created one Android Project with Ant build. And also created Test Project
I have created a Java application which has the following Apache Ant build file:
Our project team would like to switch from ant to maven for our build
How can i overwrite some existing property with a newly created properties file? Here

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.