Обычно я использую IDE, например IntelliJ, но пытаюсь перейти на VSCode, но не понимаю, почему проект, над которым я работаю, IntelliJ работает нормально, но когда я открываю этот проект в VSCode, я получаю эту ошибку. Я просмотрел другие ответы на эти вопросы, но все они упоминают такие вещи, как bin, src и путь к классам, с которыми я не очень знаком. Я предполагаю, что это если вы запустите Java через cmd, но я этого не делаю. Как я могу решить эту проблему?
Мой файл в D:\Antonio\Documents\GitLab\ProjectEuler-Java\Solved_Problems
package Solved_Problems;
class Problem_001_MultiplesOf3And5{
// Multiples of 3 and 5
/*
*
* If we list all the natural numbers below 10 that are multiples of 3 or 5, we
* get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the
* multiples of 3 or 5 below 1000.
*
*/
public static void main(String[] args) {
int totalsum = 0;
for (int i = 1; i < 1000; i++) {
if ((i % 3 == 0) || (i % 5 == 0))
totalsum += i;
}
System.out.println(totalsum);
}
}
Вывод:
Error: Could not find or load main class Problem_001_MultiplesOf3And5
Caused by: java.lang.ClassNotFoundException: Problem_001_MultiplesOf3And5
[Done] exited with code=1 in 0.835 seconds
Подробнее здесь: https://stackoverflow.com/questions/564 ... founderror