Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Maven

swatinikam2009 created the topic: Maven
Hi ,

I am trying to run java code. I have set the environment correctly. Also created MAVEN_HOME variable and added it to path varibale.
But still i am getting error message saying “count not find or load main class App”.

What to do?

rajeshkumar replied the topic: Maven
Check with your java file main method or maven directory structure.

Example
github.com/scmgalaxy/jacoco-maven-unittestv2/
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

swatinikam2009 replied the topic: Maven
Hi Rajesh,

I have done all the settings proprly but still getting the error.

So I tried to run code by followinf cmd.

c:\MavenDemos\MyPro > java -cp target/classes com.acc.App

And then it is showing me output.

Can you please tell me. Where i am doing wrong?

swatinikam2009 replied the topic: Maven
Contiued with the above query.

I have done one change. And then it is working fine . No need to use c:\MavenDemos\MyPro>java -cp target/classes com.acc.App

I have removed CLASSPATH variable from user variable in Env. variables.

Then it is working fine. so now i just type c:\MavenDemos\MyPro\target\classes>java com.acc.App

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x