Exception in thread "main" java.lang.NoClassDefFoundError

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception in thread "main" java.lang.NoClassDefFoundError

gzambotti
Hi there,

I am testing your tool but have got stuck. Here what I did
1) create a .bat file
"C:\Program Files (x86)\Java\jre6\bin\java" -cp "C:\Program Files (x86)\ArcGIS\Desktop10.0\java\lib\arcobjects.jar" "C:\tmp\osm\osm2nds_arcgis_10.0_console_1.1.1.jar" org.n52.osm2nds.core.userinterface.console.Main "C:\tmp\osm\boston.osm" C:\tmp\osm\Parameters.xml C:\tmp\osm boston
PAUSE
2) In C:\tmp\osm  I have (boston.bat - boston.osm - Parameters.xml - osm2nds_arcgis_10.0_gui_1.1.1.jar -
osm2nds_arcgis_10.0_console_1.1.1.jar
3) I am on window 7 (64 bit)

This the error the I have got:

C:\tmp\osm>"C:\Program Files (x86)\Java\jre6\bin\java" -cp "C:\Program Files (x86)\ArcGIS\Desktop10.0
\arcobjects.jar" "C:\tmp\osm\osm2nds_arcgis_10.0_console_1.1.1.jar" org.n52.osm2nds.core.userinterfac
.Main "C:\tmp\osm\boston.osm" C:\tmp\osm\Parameters.xml C:\tmp\osm boston
Exception in thread "main" java.lang.NoClassDefFoundError: C:\tmp\osm\osm2nds_arcgis_10/0_console_1/1
Caused by: java.lang.ClassNotFoundException: C:\tmp\osm\osm2nds_arcgis_10.0_console_1.1.1.jar
        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)
Could not find the main class: C:\tmp\osm\osm2nds_arcgis_10.0_console_1.1.1.jar.  Program will exit.

Please can you help. Thank you Best, Giovanni

Reply | Threaded
Open this post in threaded view
|

Re: Exception in thread "main" java.lang.NoClassDefFoundError

peterseva
Hello Giovanni!

There is a ";" missing between "C:\Program Files (x86)\ArcGIS\Desktop10.0
\arcobjects.jar" and "C:\tmp\osm\osm2nds_arcgis_10.0_console_1.1.1.jar".

Best regards,
Eva
Reply | Threaded
Open this post in threaded view
|

Re: Exception in thread "main" java.lang.NoClassDefFoundError

gzambotti
Hi Eva,

First of all, thanks for your awesome work. Your tool is really powerful, and very useful for many students here at Harvard. Let me know if you are planning to be in Boston sometime in the near feature, we will be very please to have you as a speaker at our monthly GIS meeting.

I have fixed the issue ";", and got it worked but not in my machine. In my machine (and also others)
I still have the same JAVA issue

C:\tmp\osm>"C:\Program Files (x86)\Java\jre6\bin\java" -cp "C:\Program Files (x86)\ArcGIS\Desktop10.0\java\lib
\arcobjects.jar";"C:\temp\osm\osm2nds_arcgis_10.0_console_1.1.1.jar" org.n52.osm2nds.core.userinterface.consol
e.Main "C:\temp\osm\map.osm" "C:\temp\osm\Parameters.xml" "C:\temp\osm" "Ahmedabad" "C:\temp\osm\ahmedabad.log
"
Exception in thread "main" java.lang.NoClassDefFoundError: org/n52/osm2nds/core/userinterface/console/Main
Caused by: java.lang.ClassNotFoundException: org.n52.osm2nds.core.userinterface.console.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)
Could not find the main class: org.n52.osm2nds.core.userinterface.console.Main.  Program will exit.

C:\tmp\osm>PAUSE
Press any key to continue . . .


I think this issue is only related with JAVA path settings in my windows environment. Do you have any suggestions? Again thanks for your wonderful job!

Best, Giovanni

 
Reply | Threaded
Open this post in threaded view
|

Re: Exception in thread "main" java.lang.NoClassDefFoundError

peterseva
Hi Giovanni,

Thanks! I feel very honored. Unfortunately I haven't planned to travel to Boston in the near future. I'm currently working at my master's thesis.

I tried to solve your problem. On http://javarevisited.blogspot.de/2011/06/noclassdeffounderror-exception-in.html, they suggest three ways to solve java.lang.NoClassDefFoundError.

If you used http://52north.org/downloads/geoprocessing/osm2nds/osm2ndsarcgis100console111/summary, then the manifest is definitely correct.

Does this error also occur with other releases of osm2nds?

Best wishes,
Eva
Reply | Threaded
Open this post in threaded view
|

Re: Exception in thread "main" java.lang.NoClassDefFoundError

hxpto
This post was updated on .
In reply to this post by gzambotti
Hello Eva
I have the same problem with java.lang.NoClassDefFoundError

The problem seems to be related with the PATH and CLASSPATH (http://docs.oracle.com/javase/tutorial/essential/environment/paths.html), that have to be modified in the environmental variables (My comptuter>properties>Advanced system settings>environmental variables).
I created a new PATH and in the value field I wrote: C:\Program Files\Java\jre6\bin.
Is also needed to create a CLASSPATH, but I dont Know what to write in the value field. I tried also: C:\Program Files\Java\jre6\bin, but does not work.
Can you help me about this?
Thank you very much
Filipe
Reply | Threaded
Open this post in threaded view
|

Re: Exception in thread "main" java.lang.NoClassDefFoundError

hxpto
This post was updated on .
Hi Eva, The instalation is solved. The name of the osm2nds_arcgis_10.0_console_1.1.1.jar version  was wrong. I have now a problem in the conversion, but I will post in another subject of the forum,
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Exception in thread "main" java.lang.NoClassDefFoundError

peterseva
Hello Filipe,

Sorry, I could not answer because of the holidays. I'm glad that you have found the solution for this problem in the meantime.

Best wishes,
Eva