while I was practicing some basic input method, came across this error message posted in the title:
when it ran javac InputAddress.java
; it complies correctly, but when I ran javac InputAddress
, it gives me that error message.
here is my code:
package inputaddress;
import java.util.*;
public class InputAddress
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Enter name: ");
String navn = in.nextLine();
System.out.print("Enter address: ");
System.out.print("Enter zipcode: ");
String postnr = in.nextLine();
String adres = in.nextLine();
System.out.print("Enter town: ");
String bynavn = in.nextLine();
System.out.println();
System.out.println("Address:");
System.out.println();
System.out.println(" Name: " + navn);
System.out.println(" Address: " + adres);
System.out.println(" " + postnr + " " + bynavn);
}
}
- I am using Notepad++/Sublime for writing the code, build in terminal for running the code ... (I do have Eclipse/Netbeans, but I am trying to overcome this issue,instead of avoiding it)
- if I compile and run other file *in the same folder using the same commands, it works just fine. i.e. there is a file named Exercise1.java; if I run
javac Exercise1.java
; and runjava Exercise1.class
works no problem.