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
    6

    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: 02-01-2010, 12:37 AM
  2. Replies: 14
    Last Post: 05-28-2009, 06:44 AM
  3. Public static method error
    By leapinlizard in forum New To Java
    Replies: 5
    Last Post: 04-30-2009, 12:10 AM
  4. different multiple public class and main class
    By mr idiot in forum New To Java
    Replies: 2
    Last Post: 01-01-2009, 01:10 PM
  5. Public class variable
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 10: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
  •