1 Reply Latest reply: Jul 17, 2010 6:43 PM by 843810 RSS

    package using problem

    843810
      Dear friends,

      I have tried to use package concept as pre this below link says,
      http://xahlee.org/java-a-day/package.html

      In this link under the "set of class in a directory" header, They have explained about the package using,

      According to that I have created the startMe.java file inside the /home/xxx/java/ directory.
      Then I have cretaed the packman directory in it. Inside this directory I have created the ladybug file.

      Then I have ran the stratMe.java file. It says this below error,

      startMe.java:3: package pacman does not exist
      pacman.ladybug lb = new pacman.ladybug();
      ^
      startMe.java:3: package pacman does not exist
      pacman.ladybug lb = new pacman.ladybug();


      Files:
      =====

      startMe.java

      class startMe {                                                                                                
      public static void main(String[] args) {
      pacman.ladybug lb = new pacman.ladybug();
      System.out.println("startMe done");
      }
      }


      ./packman/ladybug.java

      package pacman;
      public class ladybug {
      public ladybug () {System.out.println("ladybug initialize!");}
      }

      My class path is:
      =============
      export CLASSPATH="/opt/JMF-2.1.1e/lib/jmf.jar:/opt/JMF-2.1.1e/lib/sound.jar:/opt/JMF-2.1.1e/:/opt/jdk1.5.0_10/jre/:.:"


      Please help me to solve this issue.