For this example we'll pretend we are running "Foo" (substitute your own filename).
Assumption: File is already compiled.
Open console...
Set the current directory
to the directory containing "Foo.java"
Run command
"java Foo"
Notes:
The command is "java" not "javac"
The command argument is the class name (not filename). Thus
no
file extension.
C:\Work\Scratch>
java Foo
📋
Introduction To Objects With Java (Chapter 203 - Compiling and Running Options)
Chapter 203 - Compiling and Running Options
Run In Console
Contents
Overview
Compiling
Verifying
Running
Examples
Challenge
IDEs
Chapter
Top
Search
TOC