Results 1 to 2 of 2
  1. #1
    coco is offline Member
    Join Date
    Jul 2007
    Posts
    39
    Rep Power
    0

    Default Problems with compile applet

    I'm wanting to have a go at java. I've been trying to get the SDK from the java sun site, but every time I finally download it, it gives me an error, about it being corrupt. So, can I use any other java programs that does the same as this SDK program? As you can see, I don't know what it does, I just read that I need it to compile applets.

    Hi, I got the jdk1.1.8 but every time I'm trying to compile it, it's saying:
    Java Code:
    error: Can't read: HelloWorldApp.java
    1 error
    Here's the command I'm typing in DOS:
    Java Code:
    C:\>jdk1.1.8\bin\javac HelloWorldApp.java
    I put the HelloWorldApp.java file in the bin directory too. Can anyone help me
    Java Code:
    public class HelloWorldApp {
        public static void main(String[] args) {
            // Display "Hello World!"
            System.out.println("Hello World!");
        }
    }
    Thanks.

  2. #2
    toby is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    Try this:
    Java Code:
    class HelloWorldApp {
        public static void main(String[] args) {
            // Display "Hello World!"
            System.out.println("Hello World!");
        }
    }
    To compile:
    Java Code:
    javac HelloWorldApp.java
    To run it:

    Java Code:
    java HelloWorldApp
    And yes you should put that file in the bin directory unless you have set up classpaths to point to somewhere else.

Similar Threads

  1. applet.policy and i/0 problems
    By willemjav in forum NetBeans
    Replies: 0
    Last Post: 03-08-2008, 10:32 PM
  2. How to compile an applet to an exe
    By elizabeth in forum Java Applets
    Replies: 4
    Last Post: 02-18-2008, 03:57 AM
  3. problems when I try to run an applet
    By boy22 in forum Java Applets
    Replies: 2
    Last Post: 08-11-2007, 03:47 PM
  4. problems with applet tags
    By oregon in forum Java Applets
    Replies: 2
    Last Post: 08-06-2007, 03:19 AM
  5. problems with applet
    By paty in forum Java Applets
    Replies: 1
    Last Post: 08-05-2007, 04:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •