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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:07:53+00:00 2026-05-26T03:07:53+00:00

I have a Java application and a build file which, among its tasks, has

  • 0

I have a Java application and a build file which, among its tasks, has one task to create a jar file from the application and one to run the application

<!-- ===== Create An Executable Jar target ======-->
<target name="jar-task" depends="compile-task">
    <mkdir dir="${jar.dir}"/>
    <jar destfile="jar/Guix.jar" basedir="${gui_bin.dir}">
        <fileset dir="${basedir}">
            <include name="img/**/" />
            </fileset>
            <manifest>
                <attribute name="Main-Class" value="sys.deep.cepu.Start"/>
            </manifest>
            <filelist dir="${basedir}" files="user.properties"/>
    </jar>
</target>

<!-- 
    ============ Run target =================== 
    -->
<target name="run-task" depends="jar-task">
      <java classpath="${basedir};jar/Guix.jar;CK-DASP-2.0.0.jar;library/*;user.properties;img/* " classname="sys.deep.cepu.Start" fork="true">
    </java>
</target>

The build file runs perfectly, the jar is created and the application runs. I would like to allow the user to start the application by clicking on a single file (jar or batch file). I tried to click on the generated executable jar file but nothing happens. Is it normal? Can someone give me an help on how to execute the program from this jar or from a batch file? 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-26T03:07:53+00:00Added an answer on May 26, 2026 at 3:07 am

    When building you jar file you already specify the Main-Class. But you did not specify the required libraries in the manifest file, only in the ant file when running the application.

    Write another manifest attribute into the ant-file. The name should be Class-Path, the value a space separated list of libraries. Look here (Wikipedia) for an example.

    After that your application should start when entering

    java -jar Guix.jar
    

    Then follow the step described in this question to make it startable with a double click.

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

Sidebar

Related Questions

I have created a Java application which has the following Apache Ant build file:
I have a WorldWind application build based on the Java SDK. It has a
I have a Spring framework based Java web application, which has been built in
I have created an application in java. I have tried to create rpm file
First of all, I know how to build a Java application. But I have
I have built a Java application that has some dependencies (~10). I would like
I have built a web application using Java EE platform that sells one of
I have a Java application that launches another java application. The launcher has a
I have a Java application which I want to shutdown 'nicely' when the user
I have a java application that has Web Services published using Axis. With the

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.