Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Björn Norén
9,569 Points"Could not find or load main class"
Hello! I'm trying to use Java with Notepad++ & cmd.exe but I get the error: "Could not find or load main class ..."
Could you please take a look and see if you find what's wrong?
It works fine to compile the file:
- javac "C:\Program Files\Java\JavaKurs\laborationer\Uppgift1\DV017A-lab1\Uppgift1_1.java"
... but I get the error then when I try:
- java Uppgift1_1
- java "C:\Program Files\Java\JavaKurs\laborationer\Uppgift1\DV017A-lab1\Uppgift1_1"
- java C:\Program Files\Java\JavaKurs\laborationer\Uppgift1\DV017A-lab1\Uppgift1_1
- etc
Can you see why this won't work?
Thanks!
1 Answer
Björn Norén
9,569 PointsYes it does, sry for not including the code
public class Uppgift1_1
{
public static void main (String[] args)
{
System.out.println ("Bjorn");
}
}
Philip Gales
15,193 PointsPhilip Gales
15,193 PointsI assume Uppgift1_1.java contains main()?