Results 1 to 3 of 3
  1. #1
    _inase is offline Member
    Join Date
    Jan 2011
    Posts
    13
    Rep Power
    0

    Default public class error

    I'm new to Java so please bear with me.
    I started with this:
    public class Hello
    {
    public static void main(String[] args)
    {
    System.out.println("Hello, world!");
    }
    }

    I entered javac Hello.java into the command window and I get this error:
    Hello.java:1 error while writing Hello: Hello.class (Access is denied)
    public class Hello
    ^
    How do I fix this?
    Thank you:)

  2. #2
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    11

    Wink

    Copy your Hello.java in some another directory and try again.

    Seems like permission issue for the directory you are running your code in.

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  3. #3
    _inase is offline Member
    Join Date
    Jan 2011
    Posts
    13
    Rep Power
    0

Similar Threads

  1. Public, private or (nothing) class
    By tyang in forum New To Java
    Replies: 3
    Last Post: 01-31-2010, 11:37 PM
  2. Replies: 14
    Last Post: 05-28-2009, 05:44 AM
  3. Public static method error
    By leapinlizard in forum New To Java
    Replies: 5
    Last Post: 04-29-2009, 11:10 PM
  4. different multiple public class and main class
    By mr idiot in forum New To Java
    Replies: 2
    Last Post: 01-01-2009, 12:10 PM
  5. Public class variable
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 09:58 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
  •