473,473 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

JAVA - Package doesnot exist error

10 New Member
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:
---------------------------------------------------------------------------------------------
CreateJsonForNews.java:11: package org.json does not exist
import org.json.*;
^
CreateJsonForNews.java:12: package com.philips.util does not exist
import com.philips.util.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\NewsFetch\com\xyz\fetch\news --------- CreateJsonFor
ews.java and fetchNewsFromDataBase.java --------------These are source files

D:\SWorkspace\NewsFetch\com\xyz\utils --------- ReadJsonFile.java -- 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
1 9198
r035198x
13,262 MVP
All the required classes must be on the classpath, including the ones you created yourself.
Feb 26 '08 #2

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

Similar topics

11
by: Lem | last post by:
I get the error Exception in thread "main" java.lang.NoClassDefFoundError when I type java app2 in the command prompt. I've tried moving to the jre directory and typed java c:\app2\app2, but it...
3
by: TheLetti | last post by:
Hy! I've just downloaded the latest Java 2 SDK (j2sdk1.4.2_01). For my surprise in this version the servlet-classes are not integrated (e.g. the class javax.servlet). So I found all the...
73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
4
by: Abdelhalim MIMOUNI | last post by:
hi, i'm new to java, and using sun last JDK, and i'm trying to understand how work this feature when we want to compile at command line ? i'm trying to set the classpath to the directory of the...
0
by: dashprasannajit | last post by:
package djvusearching; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.lucene.analysis.cjk.CJKAnalyzer; //import...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
7
oll3i
by: oll3i | last post by:
i need to write publisher subscriber application on openjms and use db4o but i dont know how do i add the references to db4o when i compile the app with javac ? i added db4o-6.1-java5.jar to my...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.