Java Reference
In-Depth Information
13.
On the first line, delete the e in jre (i.e., change path=f:\jre\bin to path=f:\jr\bin).
14.
Save the source code, go to the command prompt, type f:\Employee_Application and
press Enter.
You will get the following annoying error message:
'java' is not recognized as an internal or external command, operable program or batch file.
(If you do not get this error, the System32 folder contains the java.exe file. Go to the folder, rename the file, and
do step 14 again. Don't forget to change the file name back to java after you are done with step 19.) This time the
problem is with the path environment variable. Whenever you enter text at the command prompt, Window searches
the directories in the path looking for a batch file, executable program file, or operating system command file with
the same name as the text specified. In this case we specified an incorrect folder name (jr instead of jre) when we
defined the path. Windows looked for the executable file called java (which contains the java command program) in
the folders specified in the path. The file was not in any of those folders, so Windows could not find the java command
(stored in the f:\ jre \ bin folder).
If you had specified jave instead of java in the third line, you would have gotten the same error but this time
identifying jave as the unrecognized command.
15.
In Notepad, click File, Print, and then the Print button to generate a hardcopy of the source
code in the batch file.
16.
On the first line, insert the e, and save the source code.
Just to emphasize how careful you need to be (or how picky computers are), we will create one last mistake.
17.
On the first line, add two blank spaces to the end of the statement
(i.e., change “path= f:\jre\Bin” to “path=f:\jre\Bin ”) and save the source code.
18.
At the command prompt, type f:\Employee_Application and press Enter.
You will get the “java command not recognized” error message again. Why? Because spaces are valid characters
in a folder name, therefore a folder specified as “bin ” is not the same as a folder specified as “bin.” Yikes-a-hootie!!
Isn't programming fun?
19.
Delete the two spaces, save the source code, close Notepad, and close the command
prompt session.
Tutorial: Stopping a Runaway Application in Windows
There will be occasions where you will write and/or run an application that never ends or “freezes up” (does not
respond to the keyboard or mouse). On these occasions, you will want to end the application. The Windows Task
Manager allows you to do this. (The Task Manager also displays performance information about the computer
hardware, as well as, all active applications and processes.)
There are several ways to display the Task Manager. For instance, you can start the command prompt, type
taskmgr , and press Enter. Alternatively, you can press the Ctrl, Alt, Delete keys simultaneously, and display the
Windows Security window. The Windows Security window has a Task Manager option. Ctrl-Alt-Delete is used to
regain control when the entire computer or all the applications are not responding.
However, it's easiest to simply right-click in an empty area of the task bar. The task bar is (usually) at the bottom
of the screen and shows buttons for all of the applications that are currently running. You have probably clicked the
task bar buttons to move between applications. However, right-clicking in an empty area anywhere to the right of the
Start button, displays a shortcut menu and one of the options is the Start Task Manager.
1.
Right-click in the far right of the Task bar.
2.
Click the Start Task Manager option.
 
Search WWH ::




Custom Search