1 Reply Latest reply: Jan 27, 2013 1:32 AM by EJP RSS

    I have a simple question

    987362
      I am a beginner of java, I wrote a simple HelloWorld.java first, just like this:

      package cn.com.sino;
      public class HelloWorld
      {
           public static void main(String[] args)
      {   
      System.out.println("HelloWorld!");
      }
      }

      this program is saved in D:\workspace
      in this directory , it passed javac, and i use java like this :

      d:\workspace>java cn/com/sino/HelloWorld (after i copy HelloWorld.class into d:\workspace\cn\com\sino\)

      it run correctly: HelloWorld!

      But how i use java at directory "d:\>" or "d:\workspace\cn\com\sino>" ?
      at d:\> I use "d:\>java d:\workspace\cn\com\sino\HelloWorld", But its not run right.
      Thanks very much!

      Edited by: 984359 on 2013-1-27 上午12:02
        • 1. Re: I have a simple question
          EJP
          d:\workspace>java cn/com/sino/HelloWorld

          it run correctly: HelloWorld!
          It shouldn't. The correct argument is cn.com.simo.HelloWorld.
          But how i use java at directory "d:\>" or "d:\workspace\cn\com\sino>" ?
          at d:\> I use "d:\>java d:\workspace\cn\com\sino\HelloWorld", But its not run right.
          Correct. It shouldn't.