Dynamic Jar Creation

I am trying to write a program that will automatically create compressed jar files based on previously received user input (i.e. the user's actions will determine which class files are included in the jar, as well as determine the value of some variables in these files). Is there a tutorial out there somewhere for this? Or can someone explain how? Post sample code? Thanks!

If you know exactly which files you wish to include in your JAR file, you can use the classes in the java.util.jar package to create it. The APIs are fairly straightforward.
Shaun

Similar Messages

  • Dynamic Table Creation & Fill Up

    Hello,
    Can anyone please guide where I can find examples for dynamic table creation (programmaticaly), with dynamic number of columns and rows, used to place inside text components (or whatever) to fill them with data.
    All programmatic.
    Using JSF, ADF BC
    JDeveloper 10.1.3.1
    Thanks
    Message was edited by:
    RJundi

    Hi,
    Meybe this article helps: http://technology.amis.nl/blog/?p=2306
    Kuba

  • JAR creation failed , for Command bean DC

    Hi Experts,
    I am trying to access an EJB module DC from WebDynpro through Java bean model DC.
    In this when i tried to create a Jar file of the Java bean model, i got this error.
    JAR creation failed. See details for additional information.
    Problem writing /LocalDevelopmentdc_aptcbsap.com/bin/pg/com/atos/apt/bean/APTCommandBean.class to JAR: duplicate entry: pg/com/atos/apt/bean/APTCommandBean.class
    I have created in all total 4 DC
    1) EJB DC
    2) EAR DC
    3) Java bean DC
    4) WebDynpro DC
    I have reffered to the tutorial : Using EJBs in Web Dynpro application.
    Can you tell me what am i missing?
    Ashish Shah

    Hi Sridhar,
    Thanks for your suggestion.
    I have built and deployed the EAR DC.
    But When I added the following referencesto Java bean DC
    1) EAR DC , EJB DC
    2) ejb20.jar
    and i tried to build java bean DC project, it throws error for these referenced DC.
    And these referenced DCs are removed from the project.
    Do i have to add anything in the Public part of EJB or EAR DC?
    Can you tell me how to add those references in Public part and how to utilise them in other projects?
    Regards,
    Ashish Shah

  • Jar creation from JBuilder file structure

    Hi,
    I've got a program written in jBuilder 4. It does not have the jar creation feature.
    So I've created a jar manually, but I'm having problems finding the main class from the manifest.
    I've created the manifest with no problems:
    Manifest-Version: 1.0
    Main-Class: Application1
    Created-By: me
    Where Application1 is the name of my main class. I've even tried chnging the file path to Application1 such as:
    Main-Class: programfile/classes/programname/Application1
    But whenever I create the jar and double click on it I get an error saying that cannot find main class.
    Does anybody know how to access the main class from a program created in JBuilder???
    Cheers for any help,
    Al

    Cheers for the suggestion, but I managed to sort the problem.
    For anyone else out there who's trying to jar a JBuilder file manually:
    You only need to jar the "class" folder that JBuilder creates for you, not ther entire project. (If you have a file containing images then that will need to be included as well).
    If you've not named your main class the same as the pakage name, then the mane of your main class is packagename.main
    For example if your package is called "Program" and your main class is called "Main" then you need to include the following line in the manifest:
    Main-Class: Program.Main
    Hopes this helps someone.
    Al

  • Does Seeburger's SFTP adapter support dynamic filename creation

    Hi all,
    Does the SFTP adapter support dynamic filename creation.
    If yes, then do we have to use UDF's and are there any specific settings that have to be done in the SFTP communication channel.
    Please provide a blog which helps in the configuration process of the above case.
    thanks,
    younus

    Dynamic Creation of File using counter in Seeburger Variable:
    1. Configuration Needed in the Communication Channel:
    The process of dynamic creation of files can be done we have to select the following checkbox in the receiver channel:
    Dynamic Attribute in receiver Channel:
    Import the following modules:
    Localejbs/Seeburger/solution/sftp
    Localejbs/Seeburger/AttribMapper
    Localejbs/ModuleProcessorExitBean
    Enter  the desired file naming convention:
    Use the Parameter GetCounter("ID") to the place where the counter is expected to come.
    2. Configuration Needed in the SeeBurger Workbench:
    If the J2EE server is listening on a port different from 50000 (which is the standard for the SAP client 000), the port number must be configured:
    Login into the seeburger workbench using the URL
    http://<localhost>:<port number>/seeburger/index.html
    Select Property Store.
    Create or edit the following property:
    Parameter
    Value
    Namespace
    http://seeburger.com/xi/SeeFunctions
    Key
    provider.servlet.server
    Value
    http://localhost:50000/ (where the port number 50000 must be set
    accordingly to the J2EE server configuration).
    Note: The configured value (server URL) has to end with a slash (/). Otherwise,
    SeeFunctions will not work correctly.
    If we need to start the counter from any specific value , it can be configured in the SeeBurger workbench, this value can be maintained in Mapping Variables :

  • JAR creation failed. See details for additional information.-invalid header

    Hi
    I am working with 2 databases , 1 is oracle and the other is sybase in my java application.
    The java application gets data from both the databases and creates 3 output files and 1 audit log file .
    Now i tried creating the jar file
    my manifest file looks like this :
    Manifest-Version: 1.0
    Sealed: true
    Main-Class: tableA
    Class-Path:jtds-1.2.jar;classes12.jar ----------------------------> is this correct .
    Now when i try to create the jar file it gives me an err
    JAR creation failed. See details for additional information.-
    invalid header field
    invalid header field
    ANyone pls help me ... I am creating the jar file like rhis
    export -> selecting JAR file -> selecting 1 and 3 rd checkboxes ->location of the jar file -> next->selecting 2 checkboxes in JAR PACKAGING OPTIONS -> ( my question is how to create the manifest file with class-path , their is no option ) so i am creating the manifest file and creating the jar file and then adding the class-path to the manifest file and removing the jar file and recreating the jar file now selecting the manifest file .
    is this giving the above error --> if so how to create the manifest file before creating the jar file with class-path and main class

    Double post: [http://forums.sun.com/thread.jspa?threadID=5358017&messageID=10559776#10559776]

  • Weblogic jar creation in Jbuilder 8

    Hi,
    I have installed Weblogic Server 7.0 and Jbuilder 8. I configure Weblogic as the
    application server, but there is one service (Jar Creation) which is never enabled.
    Why? Isn't it possible to create JAR files for weblogic as I did in Jbuilder 6?
    Should I use any weblogic specific tool for doing so?
    The JAR files I create with Jbuilder8 don't contain the stub and skeleton classes
    I need!!!! In Jbuilder6 it was not necessary to specify a server application for
    every service, just one for all, and it worked fine, generating everything I needed
    in my JAR.
    Help!!!!

    Is there any bea newsgroup for JBuilder, as far as there's a JBuilder Weblogic
    Edition version launched or should I try in Borland's newgroups?
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ignacio,
    I suggest contacting Borland support or posting this question in the
    related
    jbuilder newsgroup.
    Regards,
    Slava Imeshev
    "Ignacio" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have installed Weblogic Server 7.0 and Jbuilder 8. I configure Weblogicas the
    application server, but there is one service (Jar Creation) which isnever
    enabled.
    Why? Isn't it possible to create JAR files for weblogic as I did inJbuilder 6?
    Should I use any weblogic specific tool for doing so?
    The JAR files I create with Jbuilder8 don't contain the stub and skeletonclasses
    I need!!!! In Jbuilder6 it was not necessary to specify a serverapplication for
    every service, just one for all, and it worked fine, generating everythingI needed
    in my JAR.
    Help!!!!

  • Does UCM support dynamic page creation on contributor mode.?

    Hi All,
    Does UCM support dynamic page creation on contributor mode.
    We want to create new pages and link it into the existing pages
    is that possible?
    Thanks
    ~Hari

    You can create new secondary pages in contributor mode - you would normally do this via a dynamic list fragment though technically you could also achieve it by switching region content and creating new data files. You can then use the linz wizard to link between pages.
    If you are talking about creating new primary pages and sections in your site then you would need to use something like Site Studio Manager fragment.
    Tim

  • How to disable application jar creation in tmp folder

    Hi
    I am deploying an application on clustered server.
    Everytime i deploy application a jar(for the application) is getting created in admin server's tmp folder in the folder WLTEMP_APP_DOWNLOADS/<application_name>/<application_name.jar>
    I am deploying application in exploded format and one of its functionality is to generate csv files.
    As Weblogic seems to be referring the application_name.jar I get a 404 error whenever csv files are accessed in UI.
    Could somebody please suggest the settings to disable the application jar creation.

    The issue was with weblogic caching.
    The server was creating a jar of the application in a tmp folder for every deployment .
    Due to this any new file generated within deployment path was not being identified.
    Disabling caching on admin server resolved the issue.

  • Programatic JAR creation

    I am trying to create a JAR file with the java.util.jar library/package.
    I am able to create the file and get files into it but I am unable to access it from a java program.
    If i create the same jar file with the commandline utility i can access it just fine from within a java app. The two jars are identical in their content and structure however they differ in overall size of about 5-10K. Is there something special i need to do to make this jar useable by java? is the API in adequate for this kind of thing? are there any alternatives?
    -ChazZ

    the code for JAR creation:
    "files" is an arraylist i build that consists of paths to the files i wish to put in the jar
                FileInputStream fi = new FileInputStream("." + PATH_SEPARATOR + "MANIFEST.MF");
                Manifest m = new Manifest(fi);
                BufferedOutputStream bo = new BufferedOutputStream(new FileOutputStream(jarFile));
                JarOutputStream jo = new JarOutputStream(bo, m);
                Object[] f = files.toArray();
                for(int x=0; x<f.length; x++)
                    String act = (String)f[x];
                    BufferedInputStream bi = new BufferedInputStream(new FileInputStream(act));
                     //file paths are too deep in filesys to i strip off the first part of the path
                    JarEntry je = new JarEntry(act.substring(act.lastIndexOf("psdi")));
                    jo.putNextEntry(je);
                    byte[] buf = new byte[1024];
                    int anz = -1;
                    while ((anz = bi.read(buf)) != -1)
                      jo.write(buf, 0, anz);
                    jo.flush();
                    jo.closeEntry();
                    bi.close();
                jo.close();
                bo.close();
            }

  • Jar creation failed

    hi all,
    when i export java project as jar file i got a message[i] jar creation failed
    it's because of duplicate entry: .classpath
    how can i avoid this problem
    Thanks alot

    We're going to need more information to offer any realistic help. Duplicate class path entry where?
    Walk us through your process. For doing build functionality of just about any kind I would recommend learning to use ANT. It will make your life much happier.
    PS.

  • JAR creation failed in Eclipse. error in opening zip file

    When Exporting the project to Runnable JAR file in Eclipse, I have "JAR creation failed", with "error in opening zip file" in details and nothing else.
    I've tried running the new Eclipse environment by starting a new .metadata file. Then, I rebuilt the project - it runs as before.
    What zip file is referred to?

    I imagine it's the "Export destniation" jar/zip. Perhaps it's being
    used by a running application and is therefore locked against writing.
    Have you tried deleting it from the command line?
    [email protected] wrote:
    > When Exporting the project to Runnable JAR file in Eclipse, I have
    > "JAR creation failed", with "error in opening zip file" in details and
    > nothing else.
    >
    > I've tried running the new Eclipse environment by starting a new
    > .metadata file. Then, I rebuilt the project - it runs as before.
    >
    > What zip file is referred to?

  • RE: dynamic widget creation

    This is a good tech note about this on the Forte website.
    -----Original Message-----
    From: Matthew Middleton [SMTP:[email protected]]
    Sent: Friday, 25 June 1999 11:11
    To: [email protected]
    Subject: dynamic widget creation
    I have done a few windows with dynamic widget creation. Sometimes it
    seems I have to have done self.Open before, to get things to appear
    properly, and sometimes not.
    What I would like is a summation of the issues involved here so I can
    write such code without resorting to trial and error.
    with advance appreciation,
    Matthew
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Tech Note 5156, which I have attached for your information.
    -----Original Message-----
    From: Foster, Todd [SMTP:[email protected]]
    Sent: Saturday, 26 June 1999 1:27
    To: 'Jason de Cean'
    Subject: RE: dynamic widget creation
    ? What technote ?
    -----Original Message-----
    From: Jason de Cean [SMTP:[email protected]]
    Sent: Thursday, June 24, 1999 9:19 PM
    To: 'Matthew Middleton'
    Cc: 'Forte Users'
    Subject: RE: dynamic widget creation
    This is a good tech note about this on the Forte website.
    -----Original Message-----
    From: Matthew Middleton [SMTP:[email protected]]
    Sent: Friday, 25 June 1999 11:11
    To: [email protected]
    Subject: dynamic widget creation
    I have done a few windows with dynamic widget creation. Sometimes
    it
    seems I have to have done self.Open before, to get things toappear
    properly, and sometimes not.
    What I would like is a summation of the issues involved here so Ican
    write such code without resorting to trial and error.
    with advance appreciation,
    Matthew
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>

  • Exe launcher, classpath and dynamic jar loading

    hi,
    i made an exe launcher for my java app which works fine. but i need i way to specify the classpath for the application and i don't know how to do it in this case.
    it would, actually, be enough to make the app load the libraries it needs dynamically - i can make a properties file with paths to required libraries and load them upon startup. however, i don't know how do the dynamic library loading.
    anny help on specifying the classpath through an exe launcher and/or on dynamic jar library loading?
    thanx

    I'm gonna try something I've never tried before... include a link when I say search the forums/net
    Search the forums/net
    http://www.cs.put.poznan.pl/dweiss/xml/projects/invoker/index.xml?lang=en

  • Dynamic Event Creation and Handling the events

    Hi All
    I am using WAS 6.4.
    I have two components say Component A and Component B in which Component A is a reusable component and is used by other components say for e.g the Component B.
    The following is the requirement.
    Component A should create buttons for other components dynamically.
    As an example, Component B specifies to Component A the buttons required say button B1 and button B2.
    Component B also contains methods M1 and M2 for the buttons created by the component A.
    Now I would like to associate these buttons created by component A with the methods created in Component B
    The number of buttons that are to be created may vary from component to component.
    If any one as any suggestion or solution, help me out.
    Thanks
    Regards
    NagaKishore

    Hi NagaKishore,
         I'm not exactly sure why you want to do this, but it is pretty easy if I switch it up a bit.  (Maybe you are trying to create a navigation page or something?) 
         Instead of your component B using component A, if you define a Web Dynpro interface in component A, then implement this interface in component B (or all component Bs), achieving your goal would not be too difficult.  It could define a generic method (or event) with a "button key" as an argument that would tell component B which button was pressed and allow it to behave as desired.  The Web Dynpro interface defined in A could also have an interface context that would allow the the button text to be passed along with (for the sake of simplicity) a "button key" that component that should be triggered when the button is pressed.  (Note this could be a varying size list as required.)
         The component B(s) need not be known until run-time.  They can be created using something like:
    wdThis.wdGet<Used Compontne Name>ComponentUsage().createComponent(<Component Name>,<Object Name (if in a different component)>)
         Once the component is created, the context can be accessed giving the list of buttons to create and the values.  The buttons can be created in the wdModifyView during the first pass of the creation of the view displaying the buttons (after the dynamic creation of the used components which can occur in the wdDoInit of the component controller).
         If the user presses a chosen button on component A, then the generic method (most likely an event) of component Bs interface is called and passed the "button key", component B then takes over.  Note this would also work if component B had a visualization component that must be displayed through an interface view that is defined on the web dynpro component interface that is implemented by B.
         Hope this helps or at least triggers discussion that will answer your question,
           --Greg

Maybe you are looking for