ClassNotFoundException pops up when there is a class file

File directory

$ pwd
/Users/apple/Desktop/springt/javacTest
$ tree
.
 src
     com
         subject
             math
                 Hi.class
                 Hi.jav

Hi,java file

package com.subject.math;

 public class Hi{
    public static void main(String args[]){
        System.out.println("hi");
    }
}

but after the compilation is complete, ClassNotFoundException:

appears.
$ java /Users/apple/Desktop/springt/javacTest/src/Hi.class
Error: Could not find or load main class .Users.apple.Desktop.springt.javacTest.src.Hi.class
Caused by: java.lang.ClassNotFoundException: /Users/apple/Desktop/springt/javacTest/src/Hi/class

Why do I compile successfully but fail to run?

Mar.02,2021

cannot be executed in full path unless the path is a package name, and running a bytecode file does not need to wait for class, to execute the following:
enter the directory: / Users/apple/Desktop/springt/javacTest/src
execute: java Hi

if there is a package name: java package name path / Hi

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea103a-1b26.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea103a-1b26.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?