Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jnlp cannot find the main class in a Jar packaged using "OneJar".  RSS feed

Vishnu Shankar Pandey
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Felows,

I have a Jnlp trying to load an applet from a jar("a.jar") which has in turn been packaged into a bigger "project.jar".
To package the project resources into "project.jar",i have used the open source tool "OneJar".
The main class 'applet_name' is present in "a.jar".

The Manifest of ant build task to package the project jars using "One-Jar " is:

<attribute name="Main-Class" value="com.simontuffs.onejar.Boot "/>
<attribute name="One-Jar-Main-Class" value=""/>
<fileset file="${src.dir}/a.jar"/>
<fileset file="${src.dir}/otherjars.jar"/>

I have packaged the "a.jar"(containing the applet class) into the main.jar as well as the lib by specifying it in the ant task.

The Code to access it via JNLP is:
<!-- Application Resources -->
<jar href='project.jar' main='true' />

main-class='' width='1350' height='700'>

The error being thrown here is that the Jnlp cannot find my main class:

at$ Source)
at Method)
at Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at Source)

Any suggestions as to how the jnlp can find the main class(applet_name)..??

Thanks for reading all this..

Tushar Pandey

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!