-1

I have an exception when I try to run my project : java.lang.NoClassDefFoundError : Could not initialize class.

I found that it was a problem with the environnment variable CLASSPATH.

For now, it is /opt/persyst/apache-tomcat-7.0.65/bin/bootstrap.jar:/opt/persyst/apache-tomcat-7.0.65/bin/tomcat-juli.jar And it seems really weird. So I don't know what I should have in this variable. Can someone help me please ?

Sterling Archer
  • 22,070
  • 18
  • 81
  • 118
Erlaunis
  • 1,433
  • 6
  • 32
  • 50

2 Answers2

0

1.is jdk ok? look here :How to set Java environment path in Ubuntu

And pay attention between the version of your OperationSystem and jdk,they should be matched.

2.is tomcat ok? in linux you should start the tomcat by a bash file : %tomcat_home%\bin\startup.sh,every of following command can start tomcat:

1)./startup.sh

2)sh startup.sh

download tomcat: http://tomcat.apache.org/download-80.cgi

hope to have helped you

Community
  • 1
  • 1
lei tao
  • 23
  • 5
  • Thanks but everything seem ok. I use JDK7, and I just installed it. When I run tomcat with startup.sh, I have jre-home : /usr/lib/jvm/java-7-openjdk-i386. ANd it's the right version. – Erlaunis Nov 30 '15 at 16:08
  • what about the name of java/class file in your project? it was case sensitive in java,are they All upperCase or All lowerCase? – lei tao Nov 30 '15 at 16:25
  • There are both. But I don't understand what it does :/ – Erlaunis Nov 30 '15 at 16:28
  • file Name should same as the public class Name.multi class can be defined in a file,so you shold tell the jvm which is the Entrance class – lei tao Nov 30 '15 at 16:37
0

Always remember to add your all html, css, images, jsp files in your: $Tomcat_Home/webapps/your-project-directory and your java files in: $Tomcat_Home/webapps/your-project-directory/WEB-INF/classes and your jar files in: $Tomcat_Home/webapps/your-project-directory/WEB-INF/lib

Hope this will help you to sort out NCDF exception

Ghayel
  • 1,113
  • 2
  • 10
  • 19
  • please vote up or mark answer if this helped you in any case. This pleased me to go a head and work more actively in this community – Ghayel Dec 12 '15 at 18:22