0

im working with eclipse indigo, i created 2-3 work spaces and all are working fine, last day i was making a new work space same as i created before, but when i tried to start tomcat server or maven build to my project im getting the following error "Error: Could not find or load main class JDK" i went to Window --> Preferences --> Java --> Installed JREs and checked the setting of JDK and JRE but still having the same error with both JDK/JRE. also my old work spaces are working fine with same settings. i also checked the environmental variable for Java home and that is pointing to the same location where Java is installed.

Can any one help me to find out the issue. Thanks in advance.

NoNaMe
  • 6,020
  • 30
  • 82
  • 110
  • check this link http://stackoverflow.com/questions/20589718/compiler-error-error-could-not-find-or-load-main-class-com-sun-tools-javac-m – vikeng21 Oct 30 '14 at 05:57

2 Answers2

0

I went to environmental variable and get the location of JDK_HOME, then run the command prompt and went to the JDK_HOME location, There i run the following script

unpack200 -r -v -l tools.pack tools.jar and everything worked fine. hope this will help someone. Thanks.

NoNaMe
  • 6,020
  • 30
  • 82
  • 110
0

Java classpath may not set correctly.

On Linux OS,

Method 1: Set the right environment variable CLASSPATH.

echo "export CLASSPATH=$CLASSPATH:." >> /etc/profile 

Method 2: Add " -classpath . " to the java command

For example,

java -classpath . Test.class
Hello Lee
  • 321
  • 1
  • 2
  • 7