I can't seem to figure out what is wrong with this code. Eclipse tells me main method isn't declared. and when I run it in java.exe it tells me "could not find or load main class discount.java" I've spent the last half hour looking for a solution but can't seem to figure it out.
import java.util.Scanner;
public class Discount
{
public static void main (String[] args)
{
Scanner scan = new Scanner( System.in );
int price;
System.out.println("Enter the Price:");
price = scan.nextInt();
System.out.println( price / 4 * 3 );
}
}
The commands I'm using and error I'm getting:
> CD C:\Programing\Misc
> set path=%path%;C:\Program Files\Java\jdk1.8.0\bin
> javac discount.java
> java discount.java
Error: Could not find out or load main class java.discount