• Register
0 votes
105 views

Problem :

I am getting bellow compiler error
error: could not find or load main class com.sun.tools.javac.main
6 5 3
6,930 points

Please log in or register to answer this question.

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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 1 view
1 view
Problem: Error: Could not find or load main class com.sun.tools.javac.Main" Any idea what i'm doing wrong?I'm using Windows 7 command prompt. I tried to do javac and I'm getting an error that says: Error: Could not find or load main class com.sun.tools Please help, not being able to compile
asked 16 hours ago Ali 4.3k points
0 votes
1 answer 12 views
12 views
Maybe I am missing a set of Java tools? Not sure
asked Feb 13 TeamScript 13.5k points
0 votes
1 answer 65 views
65 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, 2020 LizzyM 6.1k points
0 votes
1 answer 11 views
0 votes
1 answer 30 views
30 views
Solve this.
asked Dec 28, 2020 TeamScript 13.5k points
0 votes
1 answer 1.3K views
1.3K views
Problem: I am very new to Cucumber. Recently I was reworking my project in the Intellij into my modules and suddenly I came across below error: "C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" "-Dorg.jetbrains.run.directory=C:\Users\Raphael\Documents\1_Code Stuff ... guru-pet-clinic" Error: Could not find or load main class cucumber.cli.Main Can some Cucumber expert help me in fixing above error?
asked Jul 27, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 1.5K views
1.5K 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, 2020 jwilliam 3.9k points
0 votes
2 answers 273 views
273 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 2 views
2 views
Problem: Failure executing javac, but could not parse the error: 'C:\Program' is not recognized as an internal or external command,. operable program or why this is needed in case of running mvn command. Its not needed when using other commands like javac on command prompt
asked 12 hours ago Ali 4.3k points
0 votes
1 answer 3 views
3 views
Problem: A common problem that new Java developers experience is that their programs fail to run with the error message: Could not find or load main class ... What does this mean, what causes it, and how should you fix it?
asked 1 day ago Ali 4.3k points