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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:28:50+00:00 2026-05-23T08:28:50+00:00

I have a Java swing code, I wish to execute this code via Ant.

  • 0

I have a Java swing code, I wish to execute this code via Ant. But when I do that I get following exception:

    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]                     Label label7=new Label(cval,k,JavaSamp.install_c
ountlist.get(z),timesBoldUnderline);
    [javac]                     ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:102
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]                     Label label7=new Label(cval,k,JavaSamp.install_c
ountlist.get(z),timesBoldUnderline);
    [javac]                                      ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:104
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]                     Label label8=new Label(8,k,JavaSamp.maxval,times
BoldUnderline);
    [javac]                     ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:104
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]                     Label label8=new Label(8,k,JavaSamp.maxval,times
BoldUnderline);
    [javac]                                      ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:106
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]                     Label label9=new Label(9,k,JavaSamp.maxsysval,ti
mesBoldUnderline);
    [javac]                     ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:106
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]                     Label label9=new Label(9,k,JavaSamp.maxsysval,ti
mesBoldUnderline);
    [javac]                                      ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:115
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]             Label label;
    [javac]             ^
    [javac] C:\Users\FSSD\workspace\Ex_Ant\src\com\demo\ant\WriteHelper.java:116
: cannot find symbol
    [javac] symbol  : class Label
    [javac] location: class com.demo.ant.WriteHelper
    [javac]             label = new Label(column, row, s, timesBoldUnderline);
    [javac]                         ^
    [javac] 83 errors

BUILD FAILED
C:\Users\FSSD\workspace\Ex_Ant\build.xml:7: Compile failed; see the compiler err
or output for details.

Total time: 2 seconds

What could be the reason?

My ant file is as follow:

<?xml version="1.0" ?>
<project name="Ant Example" default="execute">

<target name="init" depends="clean">
<mkdir dir="build/classes" />
</target>

<target name="compile" depends="init">
<javac srcdir="src" destdir="build/classes" />
</target>

<target name="execute" depends="compile">
<java classname="com.demo.ant.JavaSamp" classpath="build/classes" />
</target>

<target name="clean">
<delete dir="build" />
</target>

</project>
  • 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-23T08:28:50+00:00Added an answer on May 23, 2026 at 8:28 am

    You are not loading java libraries while compiling your class. Do something like this:

    Add this to your ant file:

    <path id="project.class.path">
        <pathelement location="src" />
        <pathelement path="${java.class.path}/" />
    </path>
    

    then in compile task:

    <property name="cp" refid="project.class.path" />
    <javac srcdir="src" destdir="build/classes" classpath="${cp}">
    </javac>
    

    Here in <pathelement location="src" /> give relative path to src from where the ant file is located. Or you can also give absolute path.

    You may also need to add more class path dependency based on your application. In short give path to jar folder of all required jars[If you have any beside default java lib] in project.class.path.

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

Sidebar

Related Questions

So i have this code that creates a Calculator in Java. But it is
If I have this code : import javax.swing.* import java.awt.image.* def xMap = [
i'm new in java and have a phase of code like this: import javax.swing.JOptionPane;
hey, I have this code that should save a java.util.Vector of custom serializable classes:
I have a Java swing application with a panel that contains three JComboBoxe s
I've creating a Java Swing application and I realized that I have many many
So I have this nice spiffy MVC-architected application in Java Swing, and now I
I have many years of experience in Java including Swing, Servlet and JDBC, but
I have a Java Swing application client that I want to use to consume
I have various Java Swing applications that are used by multiple users. My deployment

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.