This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

java.lang.NoClassDefFoundError error

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have recently installed java on ubuntu.
But I am starting with Java after a long time now. Please help me ...

I have been getting this error -

java.lang.NoClassDefFoundError: org/apache/commons/fileupload/servlet/ServletFileUpload

I am using these jar - /commons-fileupload-1.2.2 and commons-io-2.0.1.jar:

which I believe might be due to incorrectly set CLASSPATH ??

How to fix it?

Could you please help me with configurations I need to set up - I am listing what I know - please correct or add to it.
1 the /etc/environment file should have this
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.24/jre"
CLASSPATH="/usr/lib/jvm/java-6-sun-1.6.0.24/lib:/home/xyz/commons-fileupload-1.2.2/lib/commons-fileupload-1.2.2:/home/xyz/commons-io-2.0.1/commons-io-2.0.1.jar:"

what else should I set up?

 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a build time classpath and runtime classpath.
You are printing your build time classpath - that is the classpath used when you build your code.
If you are deploying your code, put the JAR in the WEB-INF/lib directory and try again.
 
jill Na
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks worked.
 
please buy my thing and then I'll have more money:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!