Help with my Program not sure what to do

THIS IS NOT A BUG please check and give me advice on what I am doing wrong my output is this

 sh -c javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')
 java -classpath .:target/dependency/* Main
exit status -1
import java.util.*;

public class MovieReviewProgram {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(;

        try {
            // Create a writer to save movie reviews to a file
            BufferedWriter writer = new BufferedWriter(new FileWriter("movie_reviews.txt", true));
            System.out.println("Welcome to Movie Review Program!");

            System.out.print("Please enter your name: ");
            String userName = scanner.nextLine();

            boolean continueWriting = true;
            while (continueWriting) {
                // Display movie options for the user to choose from
                System.out.println("Please choose a horror movie to review: ");
                System.out.println("1. Insidious");
                System.out.println("2. The Conjuring");
                System.out.println("3. Hereditary");
                System.out.println("4. Exit");

                // Read the user's choice
                int choice = scanner.nextInt();
                scanner.nextLine(); // Consume newline character

                String movieName = "";
                switch (choice) {
                    case 1:
                        movieName = "Insidious";
                    case 2:
                        movieName = "The Conjuring";
                    case 3:
                        movieName = "Hereditary";
                    case 4:
                        continueWriting = false;
                        // Invalid choice; prompt the user to choose a valid option
                        System.out.println("Invalid choice. Please choose a valid option.");

                if (continueWriting) {
                    // Prompt the user to write a review within a specific word limit
                    System.out.println("Hello, " + userName + "! Please write your review for '" + movieName + "' (between 50 and 200 words): ");
                    String review = scanner.nextLine();

                    if (review.length() < 50 || review.length() > 200) {
                        // Review length doesn't meet the required range; ask the user to try again
                        System.out.println("Review length should be between 50 and 200 words. Please try again.");
                    } else {
                        // Write the user's review to the file
                        writer.write("User: " + userName);
                        writer.write("Movie: " + movieName);
                        writer.write("Review: " + review);
                        writer.newLine(); // Add an extra newline for readability
                        System.out.println("Review saved successfully!");

            // Close the writer and provide a closing message
            System.out.println("Thank you for using Movie Review Program!");
        } catch (IOException e) {
            // Handle any errors that occur during file writing
            System.err.println("An error occurred while writing the review to the file.");
        } finally {
            // Close the scanner when done

THIS IS NOT A BUG TO MY KNOWLEDGE; what am I doing wrong or is the code fine and the system just bugged at the moment. I keep getting a output of

 sh -c javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')
 java -classpath .:target/dependency/* Main
exit status -1

Repl link/Link to where the bug appears:

MovieReviewProgram (1) - Replit

Screenshots, links, or other helpful context:

Also now it is giving me this as a output:

You deleted or renamed the “” file but the compiler is still trying to use that file to compile and run your program.

You need to edit your .replit file so that the main entry point and compile class is your MovieReviewProgram class.

I forked your project and changed line 2 and 3 of .replit and it worked.

run = "java -classpath .:target/dependency/* MovieReviewProgram"
entrypoint = ""

The reason you started seeing “Hello World” is probably because you recreated the file or something like that.

You can also delete the file Main.class, it’s no longer needed.

1 Like