JAVA - Package doesnot exist error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalini jain
    New Member
    • Mar 2007
    • 10

    JAVA - Package doesnot exist error

    Hi all,

    I am very new to java and have a very limited knowledge about this.
    i am stuck at one problem which is really druving me crazy..

    The problem is :

    I have written a code wherein I have included some external packages e.g:
    jdom 1.0 and self created package.
    When I am running my code in eclipse it works fine because I think it itself picks up the path of jars as well as package but while through command prompt its giving me error that package doesnot exist.

    Below are some of the lines that I get as an error:
    ---------------------------------------------------------------------------------------------
    CreateJsonForNe ws.java:11: package org.json does not exist
    import org.json.*;
    ^
    CreateJsonForNe ws.java:12: package com.philips.uti l does not exist
    import com.philips.uti l.ReadJsonFile;
    ^

    --------------------------------------------------------------------------------------------

    well I googled this issue and found that issue could be because of wrong setting of classpath but I corrected that too but its still giving me error:

    Let me give you all the picture as to where are my source files, jars and other packages and what my classpath setting is:

    D:\SWorkspace\N ewsFetch\com\xy z\fetch\news --------- CreateJsonFor
    ews.java and fetchNewsFromDa taBase.java --------------These are source files

    D:\SWorkspace\N ewsFetch\com\xy z\utils --------- ReadJsonFile.ja va -- this is self made package that I am using

    D:\Shared\jdom-1.0\build\jdom. jar --------- this is external package having jar file.

    Classpath setting is:D:\Shared\jd om-1.0\build\jdom. jar

    please suggest me what should i do? i am really stuck up at this place? I have wasted my 1 full day searching for the solution.....bu t no luck.. Please guide me..
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    All the required classes must be on the classpath, including the ones you created yourself.

    Comment

    Working...