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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trying to create my first applet" Watch "Trying to create my first applet" New topic

Trying to create my first applet

Benjamin Jankowski

Joined: Jan 18, 2013
Posts: 1
I want to create my first applet for java; I went to 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:\" (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

Joined: Jan 28, 2003
Posts: 4181

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!

I agree. Here's the link:
subject: Trying to create my first applet
jQuery in Action, 3rd edition