Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe you misunderstood your teacher. There is no java without javac, unless you use some kind of special compiler like gcj, which I suspect is not what your teacher wants. I believe that your teacher actually wants you to use the command line tools and a simple editor. The teacher is saying: I do not want you to use templates or auto suggestion to complete the assignment and you need to open a terminal and type in the commands to compile (javac) and run (java) your program yourself.</p> <p>Cay Horstman, co-author of Core JAva has a good tutorial on this in windows. <a href="http://www.horstmann.com/bigj/help/compiler/tutorial.html" rel="nofollow">http://www.horstmann.com/bigj/help/compiler/tutorial.html</a></p> <p>The process works like this:</p> <p>Java comes with a bunch of different tools and, depending on your Operating System, those tools will be installed in a directory that you can then run them from. For the purposes of this exercise, you can get by with three programs, notepad.exe, javac.exe, and java.exe. When these are installed via the Oracle installer, you might need to make sure that all of them accessible via the Windows path. </p> <p>Step 1:</p> <p>Find where you want to store your program. When I work in Windows, I use a directory called c:\dev because it is easier to type.</p> <p>Step 2:</p> <p>Create the file and save it to <code>c:\dev</code> Name it <code>MyClass1.java</code></p> <p>Step 3: Compile the file into Java Bytecode <code>javac MyClass1</code></p> <p>This will create a file called <code>MyClass1.class</code> which, depending on the actual java code inside the file, can be run with the java command (Step 4) or embedded in a web page (Step 5)</p> <p>Step 4: Run the program</p> <p><code>java MyClass1</code></p> <p>Step 5: If the class extend JApplet then you must embed a reference to the class file in a web page and then load the page in a browser. The official tutorial on this is here:<a href="http://docs.oracle.com/javase/tutorial/uiswing/components/applet.html" rel="nofollow">http://docs.oracle.com/javase/tutorial/uiswing/components/applet.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload