Results 1 to 8 of 8

Thread: create package

  1. #1
    chewyi is offline Member
    Join Date
    Jun 2010
    Posts
    3
    Rep Power
    0

    Default create package

    I am using windows 7. How to set up classpath for the following program?
    My command prompt begins as c:\Users\username>
    Thank you.

    package world;

    Java Code:
    public class HelloWorld {
      public static void main(String[] args) {
        System.out.println("Hello World");
      }
    }
    Last edited by Eranga; 08-22-2010 at 12:11 PM. Reason: code tags added

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    Is this a Windows 7 problem or a java execution problem?
    You can specify the classpath as an option with the java command.
    java -classpath THECLASSPATH;YOUNEED;HERE;. YourClassName

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Before write anything the first thing should be check the classpath settings. I wonder that why OP didn't check that, in few clicks.

  5. #5
    chewyi is offline Member
    Join Date
    Jun 2010
    Posts
    3
    Rep Power
    0

    Default

    i use jdk1.6.0_20

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  7. #7
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by Eranga View Post
    Before write anything the first thing should be check the classpath settings. I wonder that why OP didn't check that, in few clicks.
    Quote Originally Posted by Eranga View Post
    So what's really happen? Did you check the path, and did you read more about it?
    what now, the path or the classpath?
    Last edited by j2me64; 08-24-2010 at 11:15 AM.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. run package inside anthor package
    By AhmedAdel in forum AWT / Swing
    Replies: 4
    Last Post: 04-20-2010, 11:52 AM
  2. What does package do?
    By Mattedatten in forum New To Java
    Replies: 2
    Last Post: 03-13-2010, 12:48 AM
  3. Replies: 7
    Last Post: 11-09-2009, 07:51 AM
  4. Regarding package
    By makpandian in forum New To Java
    Replies: 2
    Last Post: 03-24-2009, 05:47 PM
  5. JXL Package
    By gaya3 in forum Java Servlet
    Replies: 1
    Last Post: 05-23-2008, 09:03 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
  •