473,785 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ 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:
---------------------------------------------------------------------------------------------
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..
Feb 25 '08 #1
1 9221
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
167121
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 gives me the same exception. What could be the problem? Thanks in advance, Lem
3
4803
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 servlet-classes I needed on the java.sun.com-Homepage and downloaded the javax.servlet-Package. (Maybe this file-description may help you understanding my problem:
73
8073
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 as a standard portable part of the core language, the LISP package, and the java.lang package, respectively. Both have big integers, although only LISP has rationals as far as I can tell. Because CL supports keyword arguments, it has a wider range...
4
6565
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 package but still always not working! thank's. -- AbdelHalim MIMOUNI
0
2875
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 org.apache.lucene.analysis.standard.StandardAnalyz er; import org.apache.lucene.queryParser.ParseException;
2
6967
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
7
1984
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 classpath and it doesnt work i get D:\SYSTEM~2>javac Client.java Client.java:7: package com.db4o does not exist import com.db4o.Db4o; ^ Client.java:8: package com.db4o does not exist import com.db4o.ObjectContainer; ...
5
6292
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 JDK 6 downloadable from http://java.sun.com/javase/downloads/index.jsp. I will be using JDK 5(update 8)
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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 we have to send another system
2
3645
muto222
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.