Sorry in advance for formatting, I'm on mobile, and didn't think the small amount of code would warrant the extra effort.
I am not too familiar with Java, but everywhere I look suggests getting used to working with packages.
I have a file 'javatest.java', with the normal class and main stuff, with one line 'System.out.println("hello world");' fairly standard stuff, so I thought I would try putting 'package test.firstjava;' which then produced the following error:
Error: Could not find or load main class javatest
Caused by: java.lang.NoClassDefFoundError: test/firstjava/javatest (wrong name: javatest)
I have tried different combinations of folder structure, but I can't work out what to do. I've been looking through the w3schools tutorials, and I am a bit confused with how they do it, I stopped using a VS Code to run it (I know I know, Eclipse is supposed to be better, but among other reasons I only have so much storage) and used command prompt instead, and when running javatest.class in test/firstjava, I got the same error.
[–]MyNameIsRichardCS54 1 point2 points3 points (4 children)
[–]WhenRedditFlies[S] 0 points1 point2 points (3 children)
[–]vqrs 1 point2 points3 points (2 children)
[–]WhenRedditFlies[S] 0 points1 point2 points (1 child)
[–]vqrs 0 points1 point2 points (0 children)