This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Trying to create my first applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trying to create my first applet" Watch "Trying to create my first applet" New topic
Author

Trying to create my first applet

Benjamin Jankowski
Greenhorn

Joined: Jan 18, 2013
Posts: 1
I want to create my first applet for java; I went to http://www.ehow.com/how_2085201_java-applet.html which explains how to do so; I downloaded the latest version of the Java Development Kit, created in NotePad the source code as copied and pasted from the said site, put the file I named MYFIRSTAPPLET.JAVA in my C: drive, and then put in the RUN function "javac C:\MyFirstApplet.java" (without dows quotes); when I do so, get an error message "Windows cannot find 'javac". Make sure you typed the name correctly, and then try again." How am I able to compile the source code into a *.class file so that I can embed it in an HTML page that I'm trying to create? Thank you.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4165
    
  21

You have to set the PATH environment variable to include the path to javac. See this Q&A section on the Java Tutorial.

Are you sure you want to be writing an Applet now? They are coming under pretty heavy attack - and most browsers, companies, and even Homeland Security are suggesting not to allow Java plugins to run in your browser. Why not learn Java on a desktop app? I don't mean to dissuade you from learning Java, I just want to make sure you think about it before you concentrate too much on Applets only to find out they aren't a good idea.

And Welcome to the Ranch!


Steve
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Trying to create my first applet
 
Similar Threads
Exception in thread "main" java. lang. UnsupportedClassVersion Error:
correct code to my Java console(j2sdk1.4.2_03) to establish a permanent path to bin
Javac: File Not Found
bad class file error, compiling with packages
Using a method from one program to work in another by importing