How can  I include my database file into my jar file?

Hi,
I am doing several tests for the jar command....
I tried to put the database file into my jar file, but when the program run, it just couldn't find the database file, so how may I include the database file into the jar file? Not only that, it also can't find the policy file etc.

sorry, I think I found the solution, I should have had read the API more carefully.

Similar Messages

  • How to include third party .jar files into my jar file

    Hi,
    how do i include a open source third party jar file into an executable jar?
    i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?
    currently i'm getting the following error from when executing my BlogBox.jar
    C:\MyJava\BlogBox>java -jar BlogBox.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at blogbox.BlogBox.<init>(BlogBox.java:27)
    at blogbox.BlogBox.main(BlogBox.java:103)
    Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks
    [edited msg] do i need to add the classpath at execution or something of the apache commons net library?
    Message was edited by:
    gekkokid

    When you use an executable jar the normal class path
    is ignored, but you can put a classpath inside the
    jar. The usual trick is to place the library jar
    files in a directory inside the application directory
    and direct the manifest file to it. The manifest file
    live in the jar inside the META-INF directory and
    it's called manifest.mf
    The two heavilly used entries are Main-class: and
    Class-path: lines. Class-path just has a
    comma-separated list of library paths.
    The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar
    and it works,
    thank you everyone :)

  • How can I convert the volume directory into a single file installer?

    How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.

    On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
    Are you choosing the second option (self-extracting Zip file for software installation)?
    I have a word file that I created to help me remember - is there anyway to email it to you?

  • How can we include the property value into the News RSS?

    We have defined object property u201CDepartmentu201D that is used in News XML creating form. How can we include the property value into the News RSS (set value of the particular RSS XML tag)?

    We have solved the issue with NWDS

  • Beginner: Can't convert a hello.class file into a jar file: HELP PLEASE!!!

    Hi, I created a hello.java file, converted into a hello.class file by using the java 2SDk compiler. The problem is that the hello.class file is in a directory I created: C:\JavaBuilder\hello.class
    I have a problem converting the hello class file into a jar file. I don't know which approach to take. I've looked at tutorials...but I keep getting more confused each time I view the tutorials on creating jar files. Please can someone help..by taking me through a step by step process. Please be explicit and do not leave or assume that I know any details because I'm a new born beginner. Thank you very much, I seriously appreciate it.

    Hi i did as you suggested, only with these exceptions:
    jar -cvf hello.jar C:\JavaBuilder\hello.class
    I did this and got the message: "adding : C:\JavaBuilder\hello.class (in=1150) (out=708) (deflated=38%)"
    The problem is that when I tried to execute the jar file...by typing: " java -jar hello.jar" I received the error message: "Failed to load Main-Class Manifest attribute from hello.jar" Is there any way to correct this problem? please help, thank you.

  • Beginner: Can't convert a hello.class file into a jar file. Please Help!!!

    Hi, I created a hello.java file, converted into a hello.class file by using the java 2SDk compiler. The problem is that the hello.class file is in a directory I created: C:\JavaBuilder\hello.class
    I have a problem converting the hello class file into a jar file. I don't know which approach to take. I've looked at tutorials...but I keep getting more confused each time I view the tutorials on creating jar files. Please can someone help..by taking me through a step by step process. Please be explicit and do not leave or assume that I know any details because I'm a new born beginner. Thank you very much, I seriously appreciate it.

    Hi!
    first of all, you should use an upper-case character for the first letter of your classes...
    To answer your question :
    1) you must create a directory named "meta-inf" in your directory "C:\JavaBuilder"
    2) then,you must create a file named "manifest.mf" in this directory
    it's like a property file and it must contain this :
    Main-Class: hello
    (don't forget to type <enter> after "hello")
    3) in the directory "C:\JavaBuilder", you can enter the following command :
    "jar cvfM hello.jar meta-inf\manifest.mf hello.class"
    (check jar.exe is in your path)
    4) you can run your jar by the command :
    "java -jar hello.jar"

  • Including a rms file into a *.jar file

    Hi,
    I would like to know if it's possible to include a rms (RecordStore) into a jar file off a Midlet suite. I don't want to create the RecordStore everytime i need to install my application. I tryed to copy rms.db to the instalation dir and it worked but i have tools that allow me to do that. My possible clients don't, and i wish to include the rms in the instalation to jar in order to be transparent to them. Adding file to *.jar doesn't work, because the file remains inside the *.jar and isn't installed in the application dir.
    I appreciate some help
    Thank u and by the way
    MERRY CHRISTMAS

    Hi
    I'm not aware of any technique for directly loading an RMS via the JAR.
    Instead, have you considered using a resource file and initializing the RMS from that? Or initializing from a network connection? You could also use the optional properties in the JAD for key=value pairs.
    We have used all 3 techniques - including using the resource file as a default dataset and then relegating the RMS to holding any dataset updates.
    Happy New Year

  • Conversion of a .class file into a .jar file

    Conversion of a .class file into a .jar file
    How Will I convert a .class file into a .jar file.
    Pls answer ASAP.

    You don't.
    You add a .class file into a .jar file. You don't convert anything.
    Read the help page for jar for details.

  • How can i recover my database after losing system data file.

    hi everyone,
    how can i recover my database in the following scenario.
    1. offline complete backup taken 2 days ago. database was in archive mode.
    2. today i lost my system data file, and also lost my all archived files.
    3. i started up the database but, the following error was generated.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 135338868 bytes
    Fixed Size 453492 bytes
    Variable Size 109051904 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    ORA-01113: file 1 needs media recovery
    ORA-01110: data file 1: 'D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF'
    4. i copied the system data file from backup and wrote the following statement, to recover the database.
    SQL> recover datafile 1;
    ORA-00279: change 2234434 generated at 07/15/2009 10:52:10 needed for thread 1
    ORA-00289: suggestion : C:\B\ARC00051.001
    ORA-00280: change 2234434 for thread 1 is in sequence #51
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    now i don't have any archive file. is there any chance to recover the database ?
    R e g a r d s,
    Asif Iqbal
    Software Engineer,
    Lucky Tex, Karachi,
    Pakistan.

    now i don't have any archive file. is there any chance to recover the database ?If no archive log files are available you can't recover the datafile.You need to have all the archives from the time of offline backup was taken till the system datafile is lost.
    Anand

  • How can I format my Numbers spreadsheet into a PDF file

    How can I change my Numbers spreadsheet into  a PDF format so that people to whom I send it can open it on their PC?

    You can also "share" via iCloud.
    The recipient can view it (and edit it, unless you specify read only) using a modern browser on a Mac or PC. The recipient does not need to have an iCloud account..
    SG

  • Problem in include library files into my jar file

    i am new to this jar archiving...I have created a GUI with java swings..and i also use mysql driver to connect my database now i want to make an executable jar file for my GUI..with coonector i have done the following
    I have compiled my program and placed all the .java and .class files in
    c:\ java\ bin\ jarexample
    next i created a manifest file called mainClass.txt which contains
    Main-Class: AppletMain (where AppletMain is my mainclass).. I placed this txt file also in c:\ java\ bin\ jarexample
    i m also set Class-path in manifest file Class-Path: mysql-connector-java-3.1.10-bin.jar
    next i ran jar cmf mainClass.txt example.jar *.class mysql-connector-java-3.1.10-bin
    With this line, I told jar to create a JAR file (option c) with modifications to the manifest file (option m) as specified within mainClass.txt, naming the JAR file (option f) as example.jar and including everything that matches the pattern *Class and mysql connector
    now my problem is ...my MYSQL connection need some Library files from a package called org and class Driver.class to generate connection I include this library files also in my example.jar....
    But when i execute this jar file using :java -jar example.jar
    this is executed BCOZ tha example.jar file use mysql-connector-java-3.1.10-bin.jar file from system.
    If i m this mysql-connector-java-3.1.10-bin.jar file from system from system then it is not run.
    Can anyone please tell me how can i include this library file to my jar file( ie example.jar)
    Thankyou

    Double post. Please post replies on the other thread.
    http://forum.java.sun.com/thread.jspa?threadID=656781&tstart=0

  • How can i add or create Layers into existing PDF File

    How can i create or add new Layers into new or existing PDF file using DLE JAVA API (Datalogics API)

    sandyrock,
    The PDFL, as Adobe distributes it, only has a C/C++ interface.
    The JNI APIs are developed and supported by Datalogics, the company you licensed your copy of the PDFL from. Have you contacted them? Support for their API extensions to the PDFL should be included with your licensing fee and they have many tips and ready-made examples specific to their API extensions they could give you.

  • How can I includ a web site in a jsp file?

    Hi all,
    I want to includ a web site, for example www.yahoo.com, in my jsp file. when the jsp file is called, it can return the web page to my own page. How shoud I do for that?
    I placed the code:
    <jsp:include page="http://www.yahoo.com"/> in my jsp page, but it does not work. Please help!
    Thanks.

    try checking out the include tag from the jakarta utility-taglibs.
    it can do this.
    http://jakarta.apache.org/taglibs/doc/utility-doc/index.html (include)
    this one can to
    http://jakarta.apache.org/taglibs/doc/io-doc/intro.html
    (check out "request" tag).
    hope it helps

  • How can I export the query result into access(*.mdb) file?

    Dear all:
    I want to export the query result displayed in jsp into excel file
    and access file. And I have exported the result into excel format successfully, only one line should be added in the head of Jsp:
    <%@ page contentType="application/vnd.ms-excel; charset=gb2312" %>
    But how can I export it in access(*.mdb) file? I have replaced "excel"
    with "access". But it can't achive my goal.
    What should I do to achieve my goal?
    Thanks!

    The only reason your Excel export works is that Excel knows how to interpret comma separated values as an input file format. Access has no such beast.
    If you absolutely must provide info in an mdb, one solution would be to create an ODBC datasource pointing to an empty mdb, then push data into it using the jdbc:odbc bridge, then make a copy of the file and stream it down to the browser. You may run into some ugly file locking items here - set the ODBC connection so it is not shared, and that might help.
    This one is going to be ugly.
    I suppose another approach would be to write a simple VB applicatin that uses automation to create an MDB, then stream that file down to the browser from your servlet. That would almost certainly be faster than the ODBC approach.
    - K

  • How can an imovie video be turned into an FLV file?

    How can I turn one of my current iMovie videos into an FLV file?

    If your movie is less than 10 minutes, you can use iMovie to Share it to YouTube then use iSkysofts free downloader to download the flv file to your Mac.
    http://www.iskysoft.com/free-mac-video-downloader.html
    If it's longer than 10 minutes, you'll need to find converter software.
    I don't do much with Flash myself so I'm not sure what to recommend.  Google should help.
    Matt

Maybe you are looking for

  • IPhoto can not find photo

    Upgraded to iphoto 11.  then iphoto could not find photos even though they are on my Hard Disk. Whats up with this? i manually located the  photos one at a time. This is for 400 photos one at a time?  this is crazy  man. it should simply go to " all

  • CS4 - How to woraround bug of character code replacing?

    Hi, It seems that Adobe and earlier Macromedia are nursing serious bug well known from version MX. It lies in keyboard characer conversion to strange codes when right ALT is pressed and <PARAM> "wmode" is used (most likely it happens in mode transpar

  • API8028 when deploying process flow

    I'm getting: API8028: No signature is available for mapping MS_BLD_MPS_TO_STG because the generation language is undefined. Please set the generation language property of this mapping, or generate this mapping to set the generation language property

  • Importing a picture with lightroom instructions

    I use a desk top as my main computer and a lap top for downloading from my camera in the field. I import the pictures on my laptop into Lightroom running on my laptop. I would like to work on those pictures in the field and then import those pictures

  • Browser confusion

    I simply don't know which browser I should be using to maximize Panther OS capability. If I use Safari and try to play my satelite music player using a plug-in i get a message "Plug-in not found the player has extension of 'MIME type application/xmpl