wood burning stoves*
The moose likes JNLP and Web Start and the fly likes JNLP error: Could not find main class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "JNLP error: Could not find main class" Watch "JNLP error: Could not find main class" New topic

JNLP error: Could not find main class

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 java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown 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]

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10171

Can you show us your jnlp launch file?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
akita deepak

Joined: Oct 09, 2013
Posts: 6
Sure..below is my jnlp file:

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="" href="TrainingDNA.jnlp">
<title>Training DNA</title>
<homepage href="http://www.google.com" />
<description>Web Porting Testing</description>
<jar href="TrainingDNA.jar" main="true" />
<j2se version="1.6+" />
<application-desc main-class="com.sangha.util.Relauncher" />

*The main class mentioned above 'Relauncher' is just an entry point to the application, in this class it reads a config file 'relauncher.config' which in turn specifies the main class for application. the contents of config file are as below:

Class-Start: com.sangha.gui.Main
Class-Memory: 1024
Class-Arg-0: -propsResource
Class-Arg-1: /com/sangha/gui/client.cfg
Class-Arg-2: DNA.Client
java.majorVersion: 1
java.minorVersion: 6
akita deepak

Joined: Oct 09, 2013
Posts: 6
any suggestions please
akita deepak

Joined: Oct 09, 2013
Posts: 6
It started working in 32bit java, did foll:
<jar href="TrainingDNA.jar" main="true" />
<j2se version="1.6+" />
<j2se version="1.6+" java-vm-args="-Xmx1024M"/>
<jar href="TrainingDNA.jar" main="true" />
<property name="sun.java2d.noddraw" value="true"/>
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3606

Thanks for taking the time to share the solution with us!
wood burning stoves
subject: JNLP error: Could not find main class
Similar Threads
Can applets with JDIC run on Win7 with IE9?
Error Running an Applet from HTML File
This is the error with the cattle game posted on website
Could not find main class - JNLP
Ranch Game not working?