FAQ: Learn Java: Variables - Static Checking

I also had the same issue for a bit. You likely only pressed the wrong button after typing “javac Mess.java” in the terminal. I pressed the “enter” button on my keyboard, and it worked as stated.

Not sure if its due to an update or something but when i changed the vairables to the correct types and ran it in the console i got 4 errors stating that the variables couldnt be converted to their correct types.
ex: error: incompatible types: int cannot be converted to String
Dont know if this is an issue on my part but im pretty sure i typed the right thing?
public class Mess {

public static void main(String args) {

int year = 2001;

String title = "Shrek";

char genre = 'C';

double runtime = 1.58;

boolean isPG = true;

}

}
I mean i still got the green check mark but still was just wondering about this issue.

I’ve tried to compile this exercise code using Windows Command Prompt. I was able to compile, but the command to check if a .class file was created, “ls”, dind’t work. Someone could explain me why? Maybe this command is spelled in another way for Windows?

There is a dollar sign in my terminal so it’s not letting me do anything. Can you delete this

correction:how can you delete this

You can’t delete it and you aren’t supposed to delete it.
Simply click in the terminal window with your mouse. Once the cursor starts blinking, type the commands for compiling.

1 Like

I also ran across this issue. My file compiled even though genre was still an int variable, weird.

I’m confused where is the terminal?

Click anywhere in the terminal to select it. The cursor should start blinking and allow you to type commands.

thanks _____________

Wait, so when it says enter javac Mess. java into the terminal, where exactly does that mean?