• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Urgent !!! Help needed in building JAR files

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
I had created a simple database application using 4th category drivers. The application works sucessfully when I execute the .class file. I had build the application using JBuilder IDE.
The problem start When I try to deploy the application into a executable jar file using the jbuilder options, and when i try executing the .jar files the framework of the application comes up, but the database apart does not get executed ....
Can some help me ... to find a solution ... Urgent !!!
Cheers!!!
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not a JBuilder user, but I can tell you what's need to make a JAR file executable.
In the JAR you must have a manifest file that declares which class in the JAR has a main method. The entry in this file can be as simple as:
Main-Class: ClassWithMainMethod.class
Make sure there is a null line below this entry.
To bundle it into the JAR:
$ jar -cfm name_of_JAR manifest_file class_files
then you should be able to run the whole schmeer with:
$ java -jar name_of_JAR
Hope this helps,
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited August 01, 2001).]
 
Venkatraman Prabu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
Basically the main window of my program is displayed, so the application is also executed. But when it comes to database connection the database drivers inside the .jar files does not get executed.
Regards...
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if your jar file contains the drivers etc. required files for the connection thing, you would have to place the jar file in classpath. specifically include it in the classpath like
on NT you can say -
set classpath=
%CLASSPATH%;PATH_OF_YOUR_JAR_FILE\NAME_OF_JAR_FILE.jar
hope it helps
raghav..
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You didn�t say if the jar that contains the driver is the same as the one containing the application:
If there is only one jar and the drivers are not loaded the only thing I can think of is that they are in an incorrect packect within the jar.
If there is two jar the application jar�s manifest must have a header pointing the relative URL of the jar contaning the drivers.
"Class-Path: another.jar"
The Java Tutorial has a trial about jar. Read as well the Jar File Specificatioon in the SDK Docs
By the way when executing a jar with java -jar there isn�t a classpath, but the classes are looked for in t he proper jar. This is why you need the Class-Path header in the application jar.
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic