File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JNLP and Web Start and the fly likes Could not find main class - JNLP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Could not find main class - JNLP" Watch "Could not find main class - JNLP" New topic

Could not find main class - JNLP

Joseph Obernberger

Joined: Jan 24, 2008
Posts: 2
I'm having an error occur when I try to start my application from web start. It works fine with 'java -jar IMApp.jar'. I'm using netbeans 6.0, and it generated the JNLP file for me.
When I run it under WS, I get the message could not find main class in FastInfoset.jar. I don't understand why it is looking in that library jar file when main=true is set for IMApp.jar.
I'm really stumped! Here is the JNLP:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:/C:/projects/IMApp/dist/" href="launch.jnlp">
<title>Basic Application Example</title>
<vendor>Sun Microsystems Inc.</vendor>
<description>A simple java desktop application based on Swing Application Framework</description>
<description kind="short">Basic Application Example</description>
<homepage href=""/>
<j2se version="1.5+" java-vm-args="-Djava.endorsed.dirs="C:\NetBeans6.0.1\java1\modules\ext\jaxws21\api" "/>
<jar href="IMApp.jar" main="true" download="eager"/>
<jar href="lib/FastInfoset.jar" download="eager"/>
<jar href="lib/activation.jar" download="eager"/>
<jar href="lib/appframework-1.0.3.jar" download="eager"/>
<jar href="lib/http.jar" download="eager"/>
<jar href="lib/jaxb-api.jar" download="eager"/>
<jar href="lib/jaxb-impl.jar" download="eager"/>
<jar href="lib/jaxb-xjc.jar" download="eager"/>
<jar href="lib/jaxws-api.jar" download="eager"/>
<jar href="lib/jaxws-rt.jar" download="eager"/>
<jar href="lib/jaxws-tools.jar" download="eager"/>
<jar href="lib/jsr173_api.jar" download="eager"/>
<jar href="lib/jsr181-api.jar" download="eager"/>
<jar href="lib/jsr250-api.jar" download="eager"/>
<jar href="lib/saaj-api.jar" download="eager"/>
<jar href="lib/saaj-impl.jar" download="eager"/>
<jar href="lib/sjsxp.jar" download="eager"/>
<jar href="lib/stax-ex.jar" download="eager"/>
<jar href="lib/streambuffer.jar" download="eager"/>
<jar href="lib/swing-worker-1.1.jar" download="eager"/>
<application-desc main-class="com.lovehorsepower.imapp.IMApp">

Any ideas? I'm really at a loss here.

Joseph Obernberger

Joined: Jan 24, 2008
Posts: 2
This seems like it might be a bug in Netbeans.
If I remove the
line, then it loads successfully!

Now I just need to figure out how to get netbeans 6.0.1, not to put that line in. The weird thing is that when I go to project properties, and pick 'Run', and remove the vm args, it just puts them back in.
I wonder if it's a problem with the goofy windows \ character.

akita deepak

Joined: Oct 09, 2013
Posts: 6

I have a TrainingDNA.jnlp for TrainingDNA.jar. The jar and jnlp both are host from Tomcat Apache 6(webapps/root) on linux server. The jnlp launches jar file application fine in 64bit Windows OS but when I try from:
1. IE browser 32bit OS, Win XP it gives me error : "Could not find main class : " (Attached JVM Launcher error.jpeg), I had enabled java console to see output, below is the java console error:

Java Web Start 1.6.0_43
Using JRE version 1.6.0_43-b01 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\s-projectusertwod
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
java.class.path=C:\\Program Files\\Java\\jre6\\lib\\deploy.jar
Java Path=null
MAX MEMORY=259522560
Executing: javaw.exe -Xmx1024M -classpath C:\\Program Files\\Java\\jre6\\lib\\deploy.jar com.sangha.gui.Main -propsResource /com/sangha/gui/client.cfg DNA.Client
java.lang.NoClassDefFoundError: com/sangha/gui/Main
Caused by: java.lang.ClassNotFoundException: com.sangha.gui.Main
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

2. From Firefox just java Java 6 window comes and java console flashes for a second.

PS: There is nothing wrong with the TrainingDNA.jar since it runs fine on 32bit if I don't use JNLP and double click and run it.


[JVM Launcher error.jpg]

I agree. Here's the link:
subject: Could not find main class - JNLP
It's not a secret anymore!