当我从命令行运行Main时,Java在同一包中找不到类

我将一个类从Main.java移到了自己的.java文件中,现在IDE(IntelliJ)找不到它们,即使它们位于同一包中。这是Main的第一行...

package readability;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        var filePath = args[0];
        var textAnalyser = new TextAnalyser(filePath);

...这是我从命令行运行它时遇到的错误:

C:\Users\123md\IdeaProjects\Readability Score\Readability Score\task\src\readability>java Main.java in.txt
Main.java:8: error: cannot find symbol
        var textAnalyser = new TextAnalyser(filePath);
                               ^
  symbol:   class TextAnalyser
  location: class Main

Interestingly, when I just say String filePath = "in.txt" and run it in the console, it does find the class and runs fine, so why can't it find the class when I run it from the command line? Thanks!