I compiled my java program using "javac LabOne.java" and it complied suscessfully. Now in that folder there is a LabOne.java and LabOne.class as expected. But when i try to run the program by using "java LabOne" i get an error saying "Error: Could not find or load main class LabOne".
Please can someone assist me.
Code :
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package labone;
import java.util.Scanner;
/**
*
*
*/
public class LabOne {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
System.out.println("Welcome To The String Editor!");
System.out.println("");
System.out.println("Please choose what you would like to do by choosing one of the options below:");
System.out.println("1. Input String");
System.out.println("2. Print Current String");
System.out.println("");
int userOption = userInput.nextInt();
String stringInput = new String ();
switch (userOption) {
case 1: stringInput = userInput.nextLine();
System.out.println(stringInput);
break;
case 2: System.out.println(stringInput);
break;
default: ;
break;
}
// TODO code application logic here
}
}