Help running a compiled java program

Hello,

I have created the following source code and compiled it in BlueJ version 2.1.3 with java version 1.6.0_01, but I do not know how to run it to be able to test it.

Any help would be appreciated.

import java.text.NumberFormat;

import java.util.Scanner;

import java.util.Locale;

public class PayrollProgram {

public static void main(String[] args)

{

Scanner input = new Scanner( System.in );

NumberFormat usFormat =

NumberFormat.getCurrencyInstance();

String fName;

String lName;

double hourlyRate = 0.0;

int hours = 0;

System.out.printf( "Enter the employee's name (Enter stop when finished): " );

String name = input.next();

while(!name.equals("stop"))

System.out.println("Enter the following info for the employee: ");

System.out.println("First name: ");

fName = input.next();

System.out.println("Last name: ");

lName = input.next();

System.out.printf( "Enter a positive hourly pay rate: " );

hourlyRate = input.nextDouble();

while ( hourlyRate <= 0 )

System.out.printf( "\nHourly rate must be positive: " );

hourlyRate = input.nextDouble();

hourlyRate = Double.parseDouble(input.next());

System.out.println("Hours worked this week.");

hours = Integer.parseInt(input.next());

System.out.println("Here is the employee's info.");

System.out.println("Name: " + fName + " " + lName);

System.out.println("Weekly Pay: " + usFormat.format(hourlyRate * hours));

}

}

[1596 byte] By [oricksa] at [2007-11-27 2:31:05]
# 1
open up the command line window (command prompt in XP) and type the following...java PayrollProgramthat is one way...
MaxxDmga at 2007-7-12 2:45:34 > top of Java-index,Java Essentials,Java Programming...
# 2
I think I have a version conflict:Exception in thread "main" java.lang.NoClassDefFoundError: PayrollProgram
oricksa at 2007-7-12 2:45:34 > top of Java-index,Java Essentials,Java Programming...
# 3
Read this, especially towards bottom: http://java.sun.com/docs/books/tutorial/getStarted/problems/index.html
DrLaszloJamfa at 2007-7-12 2:45:34 > top of Java-index,Java Essentials,Java Programming...