3 Replies Latest reply: Mar 10, 2010 8:01 AM by 800560 RSS

    package does not exist

    843810
      I have a java program which is accessing a class file in a package .

      import java.io.*;
      import java.util.*;
      import test.CSVReader;


      public class rule_driver {
      ...
      }



      Now CSVreader is some thing like this.

      package test;
      import java.io.BufferedReader;
      import java.io.Closeable;
      import java.io.IOException;
      import java.io.Reader;
      import java.util.ArrayList;
      import java.util.List;
      public class CSVReader {

      .....
      }

      I have surely included all the packages into classpath.And it was working also.


      I had upgraded to jdk_6_18.and new jre...

      But now it does not work. would some setting have got changed??
        • 1. Re: package does not exist
          800560
          You should post code using code tags so the forum software doesn't mess it up. There is a label when you post called "CODE" that you can click on to generate the tags, then paste your code between the tags. You should also copy and paste the exact error message. And Java coding conventions say that a class name is camel-case. RuleDriver, in your case. Using standard coding conventions will make it easier to get help here.

          It sounds like a compile time error. If it says something like "package test does not exist" then there is no directory named test in a Classpath directory when you compile. Somewhere you should have a directory named test with a CSVReader.class file in it. The test directory does not belong in the Classpath - the directory path that contains the test directory must be in the Classpath.

          Then compile with "javac -cp /path/containingtest rule_driver.java.
          • 2. Re: package does not exist
            843810
            I didnt post the code by my self and not an issue with forum software..

            Also I have the classpath set for c:/...test/ with the file csvreader.class in it.

            It had been working till the time, When I updated it for jdk6_18 for re installing my Java.

            Am I still missing some thing?
            Do I need some other installation or any thing?
            • 3. Re: package does not exist
              800560
              bjohnnj wrote:
              I didnt post the code by my self and not an issue with forum software..
              Well, for example, the *** in "import java.util.*;" did not display. So someone might think that is part of your problem.
              Also I have the classpath set for c:/...test/ with the file csvreader.class in it.
              No, it should be c:/.../.../containstest in the Classpath. So the full path to the .class file is c:/.../.../containstest/test/CSVReader.class
              It had been working till the time, When I updated it for jdk6_18 for re installing my Java.

              Am I still missing some thing?
              Do I need some other installation or any thing?
              Not that I can tell. I have never had or heard of a problem with Classpath being corrupted by an upgrade. However, it is possible that the upgrade did not work correctly and you may need to re-install. I think this is unlikely.