• Register
Log In
0 votes

Problem :

I am getting bellow compiler error
error: could not find or load main class com.sun.tools.javac.main
6.9k points

1 Answer

0 votes

Solution :

You must have done a manual installation of JDK. This error is due to a issues in your JDK installation. Please execute the bellow command in your JAVA_HOME/lib directory to resolve the issue:

unpack200 -r -v -l "" tools.pack tools.jar

Above command will unpack the tools.jar file. After that try to execute:

javac -version

This command should work well.

36.1k points

Related questions

0 votes
1 answer 19 views
Problem: When i am trying run an application in JBOSS 4.0 via eclipse 3.3 i am getting the below exception: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK I had to set the environment variables ... why this error is coming and how to fix. I am able to execute the same application with tomcat 5.0 any one can help me plz
asked Mar 23 LizzyM 5.7k points
0 votes
1 answer 410 views
Problem : When I run the apache tomcat7.0.56 in Eclipse, I get below error Error: Could not find or load main class org.apache.catalina.startup.Bootstrap How can I fix the above problem?
asked Jan 18 jwilliam 3.9k points
0 votes
2 answers 129 views
Problem : I am stuck with following Maven issue. Error: could not find or load main class org.codehaus.plexus.classworlds.launcher.launcher My Maven was working fine till last week after that I do not know what went wrong with it now it gives me the error I have tried replacing ... Java(TM) SE Runtime Environment (build 1.7.0_75-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)
asked Nov 24, 2019 alecxe 7.5k points
0 votes
1 answer 619 views
Problem : I cleaned my whole project by deleting my local directories as following ~/.gradle, ~/.m2 ~./android and ~/workspace/project/.gradle and choosing the File -> Invalidate Caches / Restart... in my Android Studio. Now execution of my command ./gradlew leads to the ... say that I deleted too much code, the question now is how can it be repaired again? Do you have any solution to fix this?
asked Jan 18 jwilliam 3.9k points
1 vote
1 answer 17 views
Problem: What is the meaning of Java could not find or load main class, and why does it happen? I’ll appreciate your sharing.
asked Mar 6 Gavin 15k points