I can't compile applets

Hi. I am very new to JAVA. (I just downloaded the compiler last night.)
I really need help. It seems anything that is suposed to be an applet, I can't compile. I can't even compile the example applet for the "Hello World!" program in the "First Cup of Java" section!!!
I've followed the instructions as I'm told, and keep getting this:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
I can however compile applications. WHAT IS GOING ON!
Please help me.
~Bewildered

Hi - I just learning Java and think I can help (at least i'll try).
Save all you work on your desktop:
Start Notepad
type the following:
Programmer: Type Your Name
Date: Type whatever date it is
Program: Simply Type the item in between brackets, without brackets: (Test1)
import java.applet.*;
import java.awt.*;
public class Test1Applet extends Applet
public void paint(Graphics g)
g.drawString("I hope I get an applet on my screen!",15, 30);
...And Save As: Test1Applet.java - MAKE SURE YOUR ON YOUR DESKTOP
Then go to File, New (Still using the Notepad application).
Type:
<Applet Code = "Test1Applet.java" Width = 400 Height = 200>
</Applet>
Then Save As: Test1Applet.html - MAKE SURE YOUR ON YOUR DESKTOP
Finally go to the console mode... otherwise known as the Command Prompt. You can go to Start Button on the statusbar click on "Run", type cmd and hit enter.
Once there you need to type: path = OK...At this time you must locate the complete path/drive where you downloaded the Java packages. Once you locate the entire drive (exam: c:\jbuilder3\java\bin) you must type in: path = drive you put the jbuilder,etc, etc in and hit enter.
You shouldn't see anything, but just another line waiting for you to enter something. That something you must type is: javac
Javac tell the os to call on Java language. You know get ready to compile. You'll then see a whole bunch of stuff, don't worry it simply computer veribage.
If no errors have occurred you then type:cd and drag and drop one of the files you saved to the desktop. Before you hit the enter key make sure to remove the file name and then hit enter.
Then you must type: javac Test1Applet.java and hit enter
Finally you must type: appletviewer Test1Applet.html and hit enter.
You should get an applet on your computer. Let me know how it turns out or whether I confused you even more.

Similar Messages

  • How can i run applets in kawa?

    how can i run compiled applet programs in KAWA
    help me

    If you always have the external display connected, you can configure the OS to consider it as the default or main display. Once everything is connected and set to your liking (resolution, color depth, etc.), "bless" the external display by clicking & dragging the menubar from the Mac's internal display onto the external. This only works if you are not using video mirroring.
    Once this is done, applications will open by default on the external and now "main" display and you can configure them to go fullscreen or whatever.

  • Jdeveloper 2.0-FATAL ERROR DURING COMPILING APPLET

    Can anyone help me about this error during the compilation of a
    applet?
    "Fatal error:cannot access class
    borland.jbcl.util.DispatchableEvent;no source found;must be
    compiled;because supefclass java.utilEventObject of class
    borland.jbcl.util.DispatchableEvent has changed"...
    1) how can i compile it?
    2) where can i find the source?
    another question..
    some compilation warning say me" there are some deprecatio
    warnig--consulting documentation for better alternative..
    Where are this documentation?
    Thanks
    null

    Official reply from Oracle via CS:
    "MacOSx 10.6.5 with Java 1.6.0_22 is not supported for JDeveloper version 11.1.1.2 and later. This has not been certified yet."

  • How can I use applet to get the desktop image of client

    hi,I have a question to ask u.
    How can I use applet to get the desktop image of client? Now I develop a web application and want user in the client to get his current image of the screen.And then save as a picture of jpeg format ,then upload it to the server?
    I have done an application to get the screen image and do upload file to server in a servlet with the http protocal.

    Since the desktop image is on the client's local hard drive, you'll need to look at trusted applets first.

  • NEW to J2EE----Class(within WEB-INF) can't access applet

    I admit I'm a newbie. Situation: an applet can import packages or individual classes that are located in WEB-INF dir. Is the reverse true, that the same classes can touch the applet? If so, how do you implement this, tried to import applet class, no luck though. I figure the reverse isn't true. Just wanted some ideas for a work around and or confirmation of my question. Thanks

    ok, security isn't an issue or concern since this is an intranet app. What I am trying to do is load and reload data to a JTable in an applet. The code that retrieves this data is located in WEB-INF. Is there a work around to make this work.

  • Can't compile.

    Hi,
    I was a VB developer and started to develop using java recently.
    I had to do some modification in a existing java project uses tomcat as the web server. I'm using Jbuilder 9 toas my editor. what I'm doing is open files using jbuilder and do the modification. I did couple of changes in my jsp files and those changes are working fine. Recently I had to do a modification in one of .java file. So I opened the file using Jbuilder and did the modification. then when I tried to compile the file It gave a lot of errors. when i run the site without the change i did to .java file it's working perfectly.
    most of the error like.
    <file name>.package <path> doesnot exist at line <line number>, column<column number>
    but those files exist in relavant folders reffered and i think when i'm compiling the .java file it can't refer those files.
    How can I compile my .java file and make the .class file.
    Thanks in advance.

    hi arijit_datta,
    Here I list down couple of errors I got when trying to compile.
    "LeaveApplication.java": package com.HRM.eLeave.dbhandle does not exist at line 3, column 35
    "LeaveApplication.java": package com.HRM.eLeave.util does not exist at line 11, column 1
    "LeaveApplication.java": cannot resolve symbol: class Environment in class com.HRM.eLeave.leaveApplication.LeaveApplication at line 31, column 72
    "LeaveApplication.java": cannot resolve symbol: class Environment in class com.HRM.eLeave.leaveApplication.LeaveApplication at line 397, column 19

  • (I can't compile it .I don't know how to write constructor in Initial Class

    All class and main program is OK except the inital class.
    Author Class
    class Author {
    private String authorName;
    private Initials inits;
    private int numTitles = 0;
    // PRE True POST Prompts user for details
    // and RETURNS new Author constructed from details
    public Author(BufferedReader in) {
    System.out.print("\nSurname ==> ");
    authorName = Text.ReadString(in);
    inits = new Initials(in);
    numTitles = 0;
    // PRE TRUE
    // POST RETURNS String representation of Author
    public String toString() {
    String result;
    result = "NAME : " + authorName + " " + inits.toString() + "\n";
    result = result + "Number of titles is " + numTitles;
    return(result);
    // PRE TRUE
    // POST Increments number of titles
    public void incTitles() {
    numTitles++;
    Book Class
    public class Book {
    private String title;
    private Author author;
    // PRE TRUE // POST Prompts user for details
    // and RETURNS new Author constructed from details
    public Book(Author author, BufferedReader in) {
    System.out.print("\nTitle ==> ");
    title = Text.ReadString(in);
    this.author = author;
    author.incTitles();
    // PRE TRUE
    // POST RETURNS String representation of Book
    public String toString() {
    String result;
    result = "TITLE : " + title + "\n";
    result = result + "AUTHOR\n" + author.toString() + "\n";
    return(result);
    *****Initial Class (I can't compile it . I don't know how to write constructor
    class Initials
    {   private char[] inits;
         public Initials(BufferedReader in)
         System.out.print("\nInitails Testing ==> ");
         inits = Text.ReadString(in);
         public String toString()
              String result;
              result="Testing";
              return(result);
    Main program
    public class BookMain {
    static private BufferedReader in = new BufferedReader(new                                    InputStreamReader(System.in));
    public static void main(String[] args) {
    Author authorRec1, authorRec2;
    Book bookRec1, bookRec2;
    System.out.println("\n\n****** First author input");
    authorRec1 = new Author(in);
    System.out.println("\n\n****** First author output\n" + authorRec1.toString());
    System.out.println("\n\n****** Second author input");
    authorRec2 = new Author(in);
    System.out.println("\n\n****** Second author output\n" + authorRec2.toString());
         System.out.println("\n\n****** First book input");
    bookRec1 = new Book(authorRec2, in);
    System.out.println("\n\n****** First book output\n" + bookRec1.toString());
    System.out.println("\n\n****** Second book input");
    bookRec2 = new Book(authorRec2, in);
    System.out.println("\n\n****** Second book output\n" + bookRec2.toString());
    System.out.println("\n\n****** First book output\n" + bookRec1.toString());

    Change this
    class Initials {
    private char[] inits;
    to this
    class Initials {
    private String inits;
    import java.io.*;
    public class BookTest {
      static private BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      public static void main(String[] args) {
        Author authorRec1, authorRec2;
        Book bookRec1, bookRec2;
        System.out.println("\n\n****** First author input");
        authorRec1 = new Author(in);
        System.out.println("\n\n****** First author output\n" + authorRec1.toString());
        System.out.println("\n\n****** Second author input");
        authorRec2 = new Author(in);
        System.out.println("\n\n****** Second author output\n" + authorRec2.toString());
        System.out.println("\n\n****** First book input");
        bookRec1 = new Book(authorRec2, in);
        System.out.println("\n\n****** First book output\n" + bookRec1.toString());
        System.out.println("\n\n****** Second book input");
        bookRec2 = new Book(authorRec2, in);
        System.out.println("\n\n****** Second book output\n" + bookRec2.toString());
        System.out.println("\n\n****** First book output\n" + bookRec1.toString());
    class Author {
      private String authorName;
      private Initials inits;
      private int numTitles = 0;
      // PRE True POST Prompts user for details
      // and RETURNS new Author constructed from details
      public Author(BufferedReader in) {
        System.out.print("\nSurname ==> ");
        authorName = Text.ReadString(in);
        inits = new Initials(in);
        numTitles = 0;
      // PRE TRUE
      // POST RETURNS String representation of Author
      public String toString() {
        String result;
        result = "NAME : " + authorName + " " + inits.toString() + "\n";
        result = result + "Number of titles is " + numTitles;
        return(result);
      // PRE TRUE
      // POST Increments number of titles
      public void incTitles() {
        numTitles++;
    class Book {
      private String title;
      private Author author;
      // PRE TRUE // POST Prompts user for details
      // and RETURNS new Author constructed from details
      public Book(Author author, BufferedReader in) {
        System.out.print("\nTitle ==> ");
        title = Text.ReadString(in);
        this.author = author;
        author.incTitles();
      // PRE TRUE
      // POST RETURNS String representation of Book
      public String toString() {
        String result;
        result = "TITLE : " + title + "\n";
        result = result + "AUTHOR\n" + author.toString() + "\n";
        return(result);
    class Initials {
      private String inits;
      public Initials(BufferedReader in) {
        System.out.print("\nInitails Testing ==> ");
        inits = Text.ReadString(in);
      public String toString() {
        String result;
        result = inits;
        return(result);
    class Text {
      static String ReadString(BufferedReader in) {
        String text = "";
        try {
          text = in.readLine();
        catch (IOException e) {
          System.out.println(e.getMessage());
          System.exit(0);
        return text;
    }

  • (short)a=1 can't compiled??

    Deal all:
    I am new to java.
    If i type as below:
    short a=1;b=2; ->can compiled
    short a,b; a=1;b=2 -> can't compiled
    short a,b;a=(short)(1);->can't compiled
    can anyboby tell me Why?
    Thanks!!!

    hi,
    i was able to compile the below statements below with jdk 1.3.
    short a=1,b=2; //->can compiled
    short a,b; a=1;b=2;// -> can't compiled
    short a,b;a=(short)(1);//->can't compiled
    if these does not work with ur version, please do send us ur error.
    regards,
    shiva

  • At what percent e-tester can identify java applet objects. Plz see message.

    Hi,
    Me new to this group.
    I am here to find out whether e-tester can test java applet or not.
    I am testing a web application which is completely Java applet base.
    Envirnment used jdk1.1.8 and Jre1.4.
    I have been trying to identify applet object used in our application.
    problem i faced:
    when i set java option in option seting for both Microsoft applet and sun system applet. where my system having jdk1.1.8 and jre1.4.
    Recording on above envirnment I am able to record my application but i can not play that. On this case I marked Abbot script generated.
    when uninstall jdk and jre.
    I am able to record and play my application still some step. But I am not able to customize it.
    this application also uses StarTree a hyporbolic tree API from
    "Business Object" now bought by SAP (this api used inside applet
    frame).
    Is any one work on e-tester to automate in and out of an application which is built in java applet.
    Can some one help me to figure out where I am doing wrong.
    Before this I worked on e-tester year back to automate one of our application and still we are doing our regression on that.
    Expecting some help

    When you say customize, are you referring to parameters? They is handled differently with applets. I believe there is documentation on this.

  • Can i compile new procedures/packages on my snapshot standby?

    Hi
    can i compile new procedures/packages on my snapshot standby?
    I need to test the new release of the application, which include some changes to current packages
    thanks

    yes you can do it, just that it will be flashbed back to the restore point when it was standby first, do anything on it, but be aware that later you convert from snapshot standby to physical standby, more time it would take for redo to be applied and also it is mandatory to open the snapshot at least once in read-write mode before it can be converted into a physical standby database.
    Regards
    Karan

  • I have jsdk2, but I can't compile servlet program

    I have jsdk2 version. which create in my c:\ dirve a folder jdk1.3. I do all the program from that. But I found that some of the class files of Servlet (servletRespose etc ) is missing. What I do to recover that. Even I can't compile any servlet program from that. Pls reply to my problems.
    Regards.
    Ranjan

    The Servlet API is part of J2EE (Java 2 Enterprise Edition). It is not included in the Standard Edition.
    So you need to download and install the J2EE reference implementation or another servlet engine such as Apache Tomcat ( http://jakarta.apache.org/tomcat ). Don't forget to put the Tomcat JAR files in your CLASSPATH when compiling your servlet program.
    Jesper

  • I can't compile this, why?

    I do not possess any means of compiling any .java file that imports javax.* or anything J2SE-related, thus, I have to compile it remotely on a remote host (www.myjavaserver.com), however, for some reason this file will not compile but will not produce any errors, warnings, or any display of any kind - but no .class file is ever found.
    import java.io.*, java.util.*, javax.servlet.*, javax.servlet.http.*;
    * Borrowed from http://forum.java.sun.com/thread.jspa?threadID=703076
    * @access public
    * @author Phil Powell
    public class RequestParameterResetter extends HttpServletRequestWrapper {
        private HttpservletRequest origRequest;
        private Map<String, String> parameterMap;
        public RequestParameterResetter(HttpServletRequest request) {
            super(request);
            origRequest = request;
            parameterMap = new HashMap<String,String>();
        public String setParameter(String key, String value) {
            String oldValue = parameterMap.put(key,value);
            if (oldValue == null) oldValue = origRequest.getParameter(key);
            return oldValue;
        public String getParameter(String key) {
            String value = parameterMap.get(key);
            if (value == null) value = origRequest.getParameter(key);
            return value;
    }Could someone tell me what I'm missing in order for this to properly compile?
    Thanx
    Phil

    Sorry I can't do that, as much as I want to. My
    computer is very ancient and has too little memory to
    run any kind of server program, especially a
    Java-related one. I tried with Eclipse a while back
    (2 years ago and never figured it out, way too hard
    in spite of my PC's inability to interact with it)
    nearly destroyed my machine with it.You actually don't need to run any server. You just need to get the .JAR files (you should try to get the same server and version that you deploy on ... but that may not be possible). Then you put them in your Java Classpath, and you will be able to compile (from command line, or whatever). You could then un-install the server if you wanted to...
    >
    That means I can only compile J2SE formatted classes
    remotelyThat would be J2EE. J2SE is the standard edition, where you get the compiler, java.lang.String, java.util.Date, and all the rest of the core stuff. J2EE is the enterprise edition for getting the javax.servlet packages (among others).
    More comments on how you might change added as comments in the code...
    on www.myjavaserver.com - provided it is
    working.
    I made the changes necessary and still can't compile
    it!
    package ppowell;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * Borrowed from
    m
    http://forum.java.sun.com/thread.jspa?threadID=703076
    * @version JSDK 1.2
    The class is a Java 5.0 class, it won't compile to JSDK 1.2.
    Ask myjavaserver.com to see how you can get ahold of the error logs so you can see what messages are generated.
    * @author Phil Powell
    * @package PPOWELL
    public class RequestParameterResetter extends
    HttpServletRequestWrapper {
    private HttpServletRequest origRequest;
    private Map<String, String> parameterMap;//if you want to use non JSE 5.0, then this line should be:
    //        private Map parameterMap;
    >
    public
    blic RequestParameterResetter(HttpServletRequest
    request) {
    super(request);
    origRequest = request;
    parameterMap = new HashMap<String,String>();//if you want to use non JSE 5.0, then this line should be:
    //            parameterMap = new HashMap();
    public String setParameter(String key, String
    ring value) {
    String oldValue = parameterMap.put(key,value);//if you want to use non JSE 5.0, then this line should be:
    //        String oldValue = (String) parameterMap.put(key,value);
    if (oldValue == null) oldValue = origRequest.getParameter(key);
    return oldValue;
    public String getParameter(String key) {
    String value = parameterMap.get(key);//if you want to use non JSE 5.0, then this line should be:
    //            String value = (String)parameterMap.get(key);
    if (value == null) value =
    value = origRequest.getParameter(key);
    return value;

  • I can' t compile Stratus example from Adobe sample...

    Hey guys !
    First, please sorry for my bad english, I'm french and it's a pain to explain this kind of problem in foreign language...
    I 'm trying to compile the example code found in Stratus sample (the audio/video chat), but I think some package are missed because Flex found a lot of error. Flex tell me that I'm trying to use some class or properties that doesn't exist...
    Here the list of the missing elements :
    - NetStreamInfo
    - Microphone.codec
    - NetStream.DIRECT_CONNECTIONS
    - Microphone.encodeQuality
    - NetStream.farId
    - Microphone.framesPerPacket
    - NetStream.info
    - NetConnection.nearId
    - NetStream.peerStream
    - SoundCodec
    I 'm using Flex Builder 3.02 (downloaded from the link at the bottom of the stratus' presentation page).I have my Stratus Key, but the problem is not here because I'm unable to launch the compilation...
    Where can I find the class / package I need ?
    In other terms, how can I compile the stratus example with no error.
    Thanks a lot !

    you probably forgot to set the minimum Flash Player version to 10.0.0 in the Flex build settings.  open the Properties for your Flex project, go to the "Flex Compiler" property, and in the "HTML wrapper" section's "Require Flash Player version" enter 10.0.0 in the boxes.  that will enable the compiler to recognize Flash Player 10 APIs.
    -mike

  • I can't compile in WindowsXP? =(

    Hello everyone,
    I upgraded my PC to WindowsXP, but when I try to compile my java progs in the command prompt, I get the following error:
    ' javac' is not recognized as an internal or external command, operable program or batch file.
    Can anyone help me with this problem, cause I can't compile java programs anymore =(

    Because I'm new to Java, does anyone happen to know where I can get a bytecode compiler so I can make programs that run with .exe (Like every commercial program out there? Or is there no solution to that?<You got your terminology wrong. "javac" is a bytecode compiler. It converts java source into "bytecodes" that run on a "Virtual Machine". To create an "exe" you must have a "native" compiler. There are a few available, the good ones are commercial and cost a lot of money. It also turns out that Sun's server VM (default in 1.4 now) is faster then some of these pricey native compilers in many situations. This is because modern VM's use JIT's or "Just In Time" compilers to create native code on the fly.
    My advice to you is this. Use one of the many nice deployment methods available for java before you start to worry about native compilation. "executable jars", Java Web Start, bootstrap launching programs... all are good options.

  • Can't compile hlp

    I just tried to compile my project (using RH 4x)... and i'm
    getting a list of errors:
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Warnock Pro Light Caption Baltic" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Warnock Pro Light Display Baltic" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Warnock Pro Light Subhead Baltic" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Caflisch Script Pro Regular Greek" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Caflisch Script Pro Regular Baltic" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Microsoft Sans Serif (Vietnamese)" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Franklin Gothic Demi Cond Baltic" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Franklin Gothic Medium Cond Greek" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Franklin Gothic Medium Cond Baltic" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Gill Sans MT Ext Condensed Bold CE" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Gill Sans Ultra Bold Condensed CE" is longer
    than 31 characters.
    HC3096: Warning: topic #1 of vmmi_online help.rtf :
    The font name "Tw Cen MT Condensed Extra Bold CE" is longer
    than 31 characters.
    I assume these are why i can't compile... I don't find these
    fonts in the list of styles i have used... how do i find if these
    have been utilized? What are my options for fixing this issue? and
    why suddenly is this happening... I had no such problem last year
    when I compiled this same file.
    Thanks,
    kb

    Today, I discovered that creating a whole new RH for Word
    project is an unnecessary step. I did the following, and it fixed
    the error of any fonts being marked as "longer than 31 characters"
    by the WinHelp compiler.
    1. Just in case, I made a backup copy of the offending source
    doc(s) somewhere else on my PC.
    2. In the RH Explorer window, I deleted the offending source
    doc(s) from the RH for Word project.
    3. I performed
    File > Import > Document
    to reimport the offending source doc(s).
    4. I made a change to the reimported source doc(s), and then
    I saved this change. If I later want to back out this change, it
    must be deleted out, NOT backspaced out. This means your cursor
    must be moved to another location in the source doc before you
    remove the change.
    For example, I add my own initials somewhere in the source
    doc, save the source doc, and then I move my cursor to the
    beginning of my initials, and use the Delete key (NOT the Backspace
    key) to remove my initials from the source doc. Of course, at this
    point, I save once more.
    5. I recompiled, and checked the Error Wizard log to be sure
    the problem is fixed.

Maybe you are looking for