Hi! I have create a simple desktop application (CRUD operation) using java derby by using the library "derbyclient.jar" I want to deploy it on another computer which not have netbeans IDE installed. I ''clean and build '' the project and a jar file created in dist folder of my project directory. When I ran this jar file , it ran successfully on my computer because it found java derby easily.

But when I closed my Netbeans IDE, and double clicked on that jar file , the application did not execute because it did not found java derby to connect.

I tried to found the solution on internet , in one solution i found that the library I used for Java derby i-e"derbyclient.jar" should also be placed in dist>lib folder. I did this but all in vain, i-e I faced same problme as told above.

Is there any method so that by using Netbeans IDE I could make executeable file of java program(which includes java derby database) so that I can run it independently on any other pc without installing Netbeans IDE?

Dani AI

Generated

Quick diagnosis: NetBeans can start Java DB (Derby) for you from the Services window, so when you run inside the IDE the client driver connects to a running local server; when you double‑click the built JAR there is usually no server process and the client driver (derbyclient.jar) simply cannot connect. (netbeans.apache.org) (db.apache.org)

Three practical deployment options (pick one depending on whether the app must be single‑user or multi‑user):

  • Embedded (single‑user, simplest): switch to the embedded engine. Add derby.jar to the project, use the embedded driver (the engine boots inside your JVM), and open the DB with a file/relative URL like jdbc:derby:mydb;create=true. This bundles the DB with your app so no external server is required. (db.apache.org)
String url = "jdbc:derby:mydb;create=true";
Connection conn = DriverManager.getConnection(url);
  • Client/server (multi‑user or separate server): keep using derbyclient.jar but ensure a Derby Network Server is running on the target machine. Run the server as a separate process/service, or start it from your application (or via system property). (db.apache.org)
NetworkServerControl server = new NetworkServerControl();
server.start(null);

Packaging and quick troubleshooting: NetBeans copies libraries into dist/lib and writes Class‑Path entries into the JAR manifest when "Copy Dependent Libraries" is used — be sure to distribute the entire dist folder (JAR + lib). Run the JAR from a console (java -jar dist/MyApp.jar or java -cp "dist/MyApp.jar;dist/lib/*" com.example.Main) to see exact exceptions: ClassNotFoundException = missing driver JAR; ConnectException = server not running. (netbeans.apache.org)

For your case, , the fastest fix is embedded mode if you only need a local desktop DB; if you must use the client driver, either install/start Derby Server on the target PC or start it from your app as shown above. ’s pointer to the official docs is a good starting reference for deployment details.

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.