Hi gentles!
jest i am creating one stand aloe application by using
JDK-1.6
Netbeans.7
Mysql

    i can run in net beans well and the database also working well with this, 

if i "clean and build" the project as jar file it working well in it's specific location (eg:D:\Raj\Gui\WorkersData\dist)

But!
if i locate the jar to another place (eg:desktop)
it show an error of "java.lang.ClassNotFoudException:com.mysql.jdbc.Driver"
actually i added the libraries of "MySQL JDBC Driver - mysql-connector" with this project, it also displaying in the class path..,

Please anyone can help me..,
I am waiting for your answer please..,

Recommended Answers

All 10 Replies

The jar file with the class listed in the error message must be on the classpath when the program is executed. Please describe how you are executing your program, where the jar file with the missing class file is and what the contents of your jar file's manifest file.

Thank you sir..,

the project is running on netbeans (image-1), sir you can see in that libraries it contain mysql jdbc driver & connetor too,

also it running on it's own path (image-2)

But!
in desk top that jar file show error sir (image-3)
can you help me please sir..,
what i have to do, Thank you..,

it's Manifest contains

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_25-b06 (Sun Microsystems Inc.)
Class-Path: lib/AbsoluteLayout.jar lib/mysql-connector-java-5.1.13-bin.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: Login

help me sir..,

Is the Class-Path: value in the manifest file correct for where your jar file is located when you try to execute it?
What is the path to your jar file? For example: C:\somefolder\anotherfolder
What is the path to the jar file with the missing class?
What is the command that you use to execute the code in your jar file?

yes the class path is correct sir,
this is path to my jar for libraries "D:\Raj\Gui\WorkersData\dist\lib" > AbsoluteLayout.jar & mysql-connector-java-5.1.13-bin.jar
this is path to my jar for project "D:\Raj\Gui\WorkersData\dist" > WorkersData.jar

i am not using any command, in netbeans jest i bult the jar file sir.., 
what i have to check for more sir..,

I don't know anything about how your IDE works. I was trying to help you execute your program when you moved your jar file away from your IDE.

if i locate the jar to another place (eg:desktop)

it show an error

I was asking questions about where the files are located and how you execute the programs in your jar file when you moved it away from the IDE.

sorry sir!
i am not move the jar to any where , jest i wants to create "stand alone application" sir,
i only copy the jar from where it create, to another place (my desktop / another system) to execute it by double click sir..,

i only copy the jar from where it create, to another place

Yes, that is what all my posts have been asking about. Please answer my questions for when you have copied the jar file to that "another place". I thought that was where you were having the problem. Trying to execute the jar file from the "another place".

sorry for the late replay sir!
i have the jar in it's original location "D:\Raj\Gui\WorkersData\dist\WorkersData.jar" (when i exicute the jar file, it is workig well here),
But!
If i copy to "Desktop" sir, i am haveig the problem to execute the jar at this place sir..,
can you please help me..,

You need to asnswer the questions I have asked about how and where:

Is the Class-Path: value in the manifest file correct for where your jar file is located when you try to execute it?
What is the path to your jar file? For example: C:\somefolder\anotherfolder
What is the path to the jar file with the missing class?
What is the command that you use to execute the code in your jar file?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.