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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:42:54+00:00 2026-05-26T04:42:54+00:00

I have created a Java application which has the following Apache Ant build file:

  • 0

I have created a Java application which has the following Apache Ant build file:

<?xml version="1.0" ?>

<project name="GUI" basedir=".">

<property name="version" value="0.2"/>
<property name="bin.dir"                        value="${basedir}/bin"/>
<property name="gui_bin.dir"                    value="${basedir}/gui_bin"/>
<property name="src.dir"                        value="${basedir}/src"/>
<property name="jar.dir"                        value="${basedir}/jar"/>
<property name="images.dir"                     value="${basedir}/images"/>
<property name="user.properties"                value="${basedir}/user.properties"/>


<!-- ============ Clean target =================== -->
<!-- Delete output files and directories -->

<target name="clean" description="Clean the directory: build, ${gen-src.dir}*, ${test.report.dir}">
    <delete dir="${jar.dir}"/>
</target>


<!-- 
============ Compile target =================== 
-->
<target name="compile">
    <mkdir dir="${gui_bin.dir}"/>
    <javac srcdir="${src.dir}" destdir="${gui_bin.dir}" classpath="${basedir}/EFCore-1.0.0.jar" fork="true">
    </javac>
</target>


<!-- 
============ Create Executable Jar target =================== 
-->
<target name="jar" depends="compile">
    <mkdir dir="${jar.dir}"/>
        <jar jarfile="jar/UPHECGui.jar" basedir="gui_bin" includes="**/*.class">
            <fileset dir="${basedir}">
                <include name="images/**/; EFCORE-1.0.0.jar" />
                </fileset>
                <manifest>
                    <attribute name="Main-Class" value="eu.keep.uphec.GUI"/>
                    <attribute name="Class-Path" value="EFCORE-1.0.0.jar"/>
                </manifest>
                <filelist dir="${basedir}" files="user.properties"/>
        </jar>
    </target>

<!-- 
    ============ Run target =================== 
    -->
<target name="run" depends="jar">
    <java classpath="jar/UPHECGui.jar;EFCORE-1.0.0.jar" classname="eu.keep.uphec.GUI" fork="true">      
    </java>
</target>

The tasks execute successfully: the jar task creates the jar and the run task launches successfully the application. When I go and try to execute the jar in a command line with the following code:

 C:\UPHECGUI\GUI-Project\ java -jar jar/UPHECGui.jar

the application throws the error:

Exception in thread "main" java.class.NoClassDefFoundError: eu/keep/kernel/CoreObserver
at.............
...............
...............
Could not find the main class: eu.keep.uphec.GUI. Program will exit.

Now, the GUI class with the main method is exactly in the specified folder (the run task executes successfully with this parameter).
Here is a screenshot of the folder where the application is based:

enter image description here

Can someone please tell me what’s wrong with it? I spent hours trying to figure it out but nothing has come out yet 🙁
An help would be highly apreciated, thanks!!!!

  • 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-26T04:42:55+00:00Added an answer on May 26, 2026 at 4:42 am

    The -jar option uses the manifest of the jar to set the classpath. Since your application depends on the jar EFCORE-1.0.0.jar, this jar should be in the classpath specified in the manifest of your UPHECGui.jar.

    See http://download.oracle.com/javase/tutorial/deployment/jar/downman.html for explanations.

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

Sidebar

Related Questions

I have a Java application and a build file which, among its tasks, has
I have created a simple Java application which has a JFrame and few JButtons.
I have created a java application which has a JTabbedPane that contains three JPanels.
I have created a java application and packed it into a jar file on
I have a java application which has a GUI in both English and French,
I have an java EE application which has one message-driven bean and it runs
I have created a java application for Debian Linux. Now I want that that
Hi I have created a java application. I found there is an application menu
I have created a sample java socket application. I used Socket s = new
Using Restlet I have created a router for my Java application. From using curl,

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.