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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:12:43+00:00 2026-06-16T19:12:43+00:00

I created a runnable jar using ant but it is not running. when I

  • 0

I created a runnable jar using ant but it is not running. when I run the jar I am getting following error

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/teamdev/jxbrowser/events/NavigationListener
    at com.MainClass$2.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.ClassNotFoundException: com.teamdev.jxbrowser.events.NavigationListener
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 15 more

but when I created jar using eclipse that jar worked fine. Menifest of jar I created with ant is as below

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_37-b06-434-11M3909 (Apple Inc.)
Main-Class: com.MainClass
Class-Path: ./ commons-cli.jar commons-codec-1.2.jar commons-httpclien
 t-3.0.1.jar commons-logging-1.1.1.jar ffmpeg-java.jar fmj.jar jdom.ja
 r logback-classic.jar logback-core.jar lti-civil-no_s_w_t.jar mail.ja
 r mp3spi1.9.4.jar slf4j-api.jar tritonus_share.jar vorbisspi1.0.2.jar
  xuggle-xuggler.jar comfyj-2.9.jar engine-gecko.jar engine-ie.jar eng
 ine-webkit.jar jniwrap-3.8.4 jxbrowser-3.3.jar jxbrowserdemo.jar log4
 j-1.2.15.jar MozillaInterfaces.jar runtime.jar slf4j-api-1.5.8.jar sl
 f4j-log4j12-1.5.8.jar winpack-3.8.3.jar xulrunner-mac.jar 

and menifest of jar I created with eclipse is as below

Manifest-Version: 1.0
Rsrc-Class-Path: ./ jniwrap-3.8.4.jar lti-civil-no_s_w_t.jar commons-h
 ttpclient-3.0.1.jar slf4j-log4j12-1.5.8.jar vorbisspi1.0.2.jar slf4j-
 api.jar ffmpeg-java.jar fmj.jar commons-codec-1.2.jar engine-ie.jar x
 ulrunner-mac.jar commons-logging-1.1.1.jar winpack-3.8.3.jar mp3spi1.
 9.4.jar tritonus_share.jar commons-cli.jar jdom.jar MozillaInterfaces
 .jar comfyj-2.9.jar jxbrowser-3.3.jar runtime.jar logback-classic.jar
  engine-gecko.jar mail.jar engine-webkit.jar log4j-1.2.15.jar jxbrows
 erdemo.jar slf4j-api-1.5.8.jar logback-core.jar xuggle-xuggler.jar
Class-Path: .
Rsrc-Main-Class: com.MainClass
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader

both are same and all dependencies are also inside the created jar but still the jar create with ant is not working.
I know you would recommend me to create jar with eclipse but I want to obfuscate my code that’s why I am using ant to create runnable 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-16T19:12:44+00:00Added an answer on June 16, 2026 at 7:12 pm

    I guess that your jar file generated with Ant does not have jar-in-jar-loader, that’s why it is not able to find classes inside embedded jars.

    When you generate JAR with Eclipse you can Save Ant script, then jar-in-jar-loader.zip file would be added to project. Then use generated Ant file to create your JAR. This approach works for me.

    Your Ant script should look like this:

        <jar destfile="C:\Users\\workspace\Your.jar">
            <manifest>
                <attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
                <attribute name="Rsrc-Main-Class" value="org.mypackage.MainClass"/>
                <attribute name="Class-Path" value="."/>
                <attribute name="Rsrc-Class-Path" value="./ libA.jar "/>
            </manifest>
            <zipfileset src="jar-in-jar-loader.zip"/>
            <fileset dir="${ProjectPath}/bin"/>
            <zipfileset dir="${ProjectPath}\lib" includes="libA.jar"/>
        </jar>
    

    First zipfileset would include jar-in-jar-loader.zip

    fileset would add all your classes

    Second zipfileset would add libA.jar as embedded jar and same should be mentioned in Rsrc-Class-Path

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

Sidebar

Related Questions

I am using the Maven-Shade-Plugin to create a runnable Uber-jar. According to the last
I have a single .jar file that I create by using the runnable .jar
Loading a hibernate based runnable jar on ec2, I am suddenly getting a hibernate.cfg.xml
I have created Java Swing application that i have exporter to runnable jar file.
I need help with this mistake. I have created a Runnable jar with two
I created a jar file with a runnable compiled class and some template files
I'm trying to build a runnable JAR using Eclipse's Export function. everything works fine
I was creating a runnable jar using eclipse indigo where I encountered two options:
I am trying to run a jar using this command in my shell script
If I create a runnable object Runnable run = new MyRunnable(); And then pass

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.