By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,592 Members | 1,931 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,592 IT Pros & Developers. It's quick & easy.

JAVA - Package doesnot exist error

P: 10
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:
--------------------------------------------------------------------------------------------- package org.json does not exist
import org.json.*;
^ package does not exist


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\NewsFetch\com\xyz\fetch\news --------- CreateJsonFor and --------------These are source files

D:\SWorkspace\NewsFetch\com\xyz\utils --------- -- 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\jdom-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.....but no luck.. Please guide me..
Feb 25 '08 #1
Share this Question
Share on Google+
1 Reply

P: 13,264
All the required classes must be on the classpath, including the ones you created yourself.
Feb 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.