I am trying to run my netbeanz project from command line , it works when I run it from the netbean IDE
I have already read this and this and the sun java tutorial but I am still unable to solve the problem.
My main file : hill.java is located in the following folder
In command line , I change directory to the above and run javac *.java which works as expected
The problem arises when I attempt to java hill ( hill.java is the name of my main class file )
Contents of directory hill
hill.java
package hill;
import java.util.Random;
import java.io.*;
import java.util.*;
import java.math.*;
public class Hill
{
public static void printmenu()
{
printline();
System.out.println("Welcome to Hill Cipher");
System.out.println("1) Key Generation");
System.out.println("2) Encrypt");
System.out.println("3) Decrypt");
System.out.println("4) Quit");
printline();
}
public static String readString(String prompt)
{
System.out.print(prompt);
return new java.util.Scanner(System.in).nextLine();
}
public static int readInt(String prompt)
{
int input = 0;
boolean valid = false;
while (!valid) {
try {
input = Integer.parseInt(readString(prompt));
valid = true;
} catch (NumberFormatException e) {
System.out.println("*** Please enter an integer ***");
}
}
return input;
}
public static void main(String[] args)
{
int choice=0;
do
{
printmenu();
choice = readInt("Please select your option : ");
selectmenu(choice);
}while (choice != 4);
}
}
What am I doing wrongly and how do I solve this problem ??