-1
package com.company;
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.concurrent.ThreadLocalRandom;

public class Main {

    //Objeler
    static int hak_sayisi = 5;
    static int kazanilacak_puan,secilmissayi = 0,mevcut_puan = 0;
    static String sayı_aralık;

    public static void main(String[] args) {
        // Hoşgeldin ve Kurallar Bölümü
        System.out.println("Merhaba, 'Sayı Tahmin Etmece' oyununa hoşgeldiniz! ");

    }
}

This code works fine in IntelliJ IDEA, but when I try to run it in an online IDE I get this error:

Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main

What does this mean and how do I fix it?

bgebes
  • 95
  • 1
  • 13

1 Answers1

0
package com.company;

Get rid of the package name at the top. JDoodle can't find Main if it's inside a package.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578