javac <file>
To run the RandList program, type java RandList.class (try it now; more soon!).
An application is a stand-alone program that runs on your machine.
An Applet is a program that is executed over the Internet, typically by a browser.
The browser must have the Java plug-in, so for consistency we will use a tool called appletviewer.
In either case, since it is browser-based, you must give it an HTML file to run the Applet.
Here is a basic HTML file for running an Applet (you may copy and paste, please put in your own name):
<html>
<head>
<title>Hello World by Your Name</title>
</head>
<body>
<p>Hello World Applet
<applet code="HelloWorld.class" width=300 height=200>
</applet>
</body>
</html>
Note that the HTML file references the Applet, but it uses the file name that contains the .class file, which in this is case "HelloWorld.class".
What file did this HelloWorld.class come from? And what filename should this HTML code be in?
java <class-name>
appletviewer <file>
Error - Running the HelloWorld Applet with the java command
java HelloWorld
Exception in thread "main" java.lang.NoSuchMethodError: main
Edit HiWorld.java in your Linux environment and type in this code (note, you cannot copy/paste it, so practice by typing):
Play around and try these errors: