Updating a JAR that uses packages

Hi There,
I have a problem in that I am trying to update a class within a JAR which uses packages. The issue is that when updating the JAR, the class I have requested to update is simply placed in the root of the JAR and not in the required package.
I need to to this within a Java program, so unpacking and re-packing the JAR is not an option.
Here is what i've been trying:
I have a class called UserProfile.class, which resides within my messages package - Structure: /messages/UserProfile.class
When I call the update command:
jar uf C:\AdminUI.jar E:\project\code\Eclipse_Proj\messages\UserProfile.class
It creates the folder structure /project/code/Eclipse_Proj/messages within the JAR file and places UserProfile.class within this folder - when in fact the UserProfile.class should be placed within the /messages folder.
Any ideas on how I can place the class in the correct folder would be much appreciated.
Thanks very much
K
null

Thanks for the reply!
Yeah that works, but i'm trying to update the JAR from a Java program using
Runtime.getRuntime().exec()
but when I try to run the command Runtime.getRuntime().exec("cd c:") I get the below exception:
java.io.IOException: CreateProcess: cd c: error=2
I understand there is a -C parameter to temporarily change directory so I tried the following command:
jar uf C:\AdminUI.jar -C E:\project\code\Eclipse_Proj \messages\UserProfile.class
But this simply inserts the UserProfile.class into a jar under the following directory structure:
project/code/Eclipse_Proj/messages/UserProfile.class
Thanks again for your help.
Any input much appreciated
K

Similar Messages

  • Update Multiple Records by Using Package..

    Hi All,
    I have designed OA page which contains multiple records in a tabular format and few fields are editable. Now I want to update few records by using package. Bcoz page view object is too much complex. So it is impossible to create view object from EO. That’s why I want to update some value by using package.
    Please help me…
    Thanks in advance..
    Thanks
    --Subhas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    Use plsql record type for this type of requirement.
    Refer folllowing steps:
    1) Create a plsql record type in the database ,
    2) create a plsql procedure/package and use above record type as parameter in the procedure.
    3) call this procedure from OAF side.
    Thanks,
    Kumar

  • Error updating a datablock that uses a view

    I have a view that is using a UNION ALL between two tables. I have written the instead of trigger properly and I have no problem updating, inserting or deleting thru the view in Oracle.
    The problem is that forms will query the view fine, but will not allow me to update any field associated with the datablock. I'm getting the following error message:
    "FRM-40501: ORACLE error: unable to reserve record for update or delete"
    and when I do display error, I get the following message:
    "ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc."
    Any help would be appreciated, thanks in advance!

    Well I only did the instead of trigger thing once.. But Ill stick my neck out anyway...
    Since you have instead of triggers you may be able to get away with just putting a "null;" in the on-lock trigger or write your own locking code in the on-lock trigger. Search for locking in this forum for examples.
    I think using the instead of triggers may override the need to specifically put insert, update, and delete statements in on-update, on-delete, on-insert form triggers.
    Basically with instead of triggers the form will try to do its normal processing and issue select, insert, update, and delete statements on the view, which usually causes headaches, but the instead of triggers on the view will take over do the DML upon other appropriate tables making everybody happy. I think the locking is your issue.
    Now if you werent using instead of triggers you would have to put update, insert, delete statements in the on-insert, on-update, on-delete triggers.
    I think.. :)

  • Problem updating pages that use .dwt file

    So i have 45 files that all use the same .dwt file.  Usually when I make a change to the template and go file > save it asks me if i want to update all pages that use that specific .dwf file.  For some reason it doesn't show the pages that do.  Although if I go to the specific page for example contact.html and do a Modify > Templates > Apply template to page, it applys the changes, and then once i make a change to the .dwt file and do the File > Save, contact.html now appears in the section of files to be updated.  I do not want to go thru every page and manually apply the template does anyone have any information that could help me out? thanks
    G8ofH8

    I do not want to go thru every page and manually apply the template does anyone have any information that could help me out?
    However, that would work.
    It sounds like your site cache has become corrupted.  Try the following -
    1.  Open DW's Site manager, select the site name, and click on EXPORT (make sure you opt to export the FULL site defintion including FTP info)
    2.  Export the site definition to a KNOWN location on your hard drive
    3.  With the site name still selected in Site manager, click REMOVE to remove that site from your list of definitions
    4.  Import the site definition you just exported - that should solve the updating problem
    Does this heal things for you?

  • Error while updating a jar file

    I am trying to update a jar file using teh following command
    jar -uf project.jar fileMy.prop
    however while doing that i get the following error
    java.io.IOException: Error in writing existing jar file
    at sun.tools.jar.Main.run(Main.java:179)
    at sun.tools.jar.Main.main(Main.java:904)

    Perhaps some process (your java program perhaps) is still running that has the file open still? You'll need to shut down the process(es) that have it open. Or you don't have proper rights to the directory/file. Not a java issue.

  • Problem in updating a jar file

    Hi ...
    Anyone help me for updating a jar file in windows.
    I am updating a jar file Using Runtime.exec() method.. But it shows an error like this:
    java.io.IOException: Error in writing existing jar file
    at sun.tools.jar.Main.run(Main.java:198)
    at sun.tools.jar.Main.main(Main.java:1022)
    I am using jdk1.6 and ant tool for build.

    Stick to your old thread please.
    [http://forums.sun.com/thread.jspa?threadID=5320704&messageID=10371347#10371347]
    I'll delete this one soon.

  • [svn:bz-3.x] 5267: Update 3.x branch to include browserServer. jar in the packaged qa sdk zip.

    Revision: 5267
    Author: [email protected]
    Date: 2009-03-12 11:17:14 -0700 (Thu, 12 Mar 2009)
    Log Message:
    Update 3.x branch to include browserServer.jar in the packaged qa sdk zip.
    Modified Paths:
    blazeds/branches/3.x/qa/apps/qa-regress/build.xml

    I've been playing with this too.
    What kills it for me is my inability to get intelfb running properly on my eee 900 (says the module is loaded but there is no /dev/fb/0 device). One suggestion is to use a vga= code instead of video=intelfb:[etc] in my /boot/grub/menu.lst . But that makes it impossible to have the 1024x600 resolution of the eee's screen, so I haven't even tried it.
    Why intelfb? Because mplayer's directfb driver has tearing even with buffermode=triple and mplayer's -double tag enabled when using uvesafb. Maybe I am assuming too much that the intelfb would have the hardware acceleration hooks necessary to make it work?
    The other thing that cripples it for me is the "stuck at 16 colors" nature of Linux console even when running a framebuffer with a 32-bit background. I've gotten a tip on changing those colors but it is obtuse at best. Very surprised that there hasn't been a 256 color (at least) framebuffer console developed yet. (Unless screen magically enables the extra colors?) dfbterm looks interesting but the last thing I want is windowed terminals when I am trying to use CLI.
    Last edited by jceasless (2009-06-03 18:54:51)

  • How to use packages and jar files for applet?

    Hi!
    My applet takes a class say a.class.
    Now this class depends on other classes that are packaged
    in a directory and put separately.
    I want to put this applet on the web.
    So how do I manage the .class files in he package.
    I have tried using jar file format.But I was not able to get it working.
    Can someone please help me?
    Thanks

    Use Archive instead of codebase:
    <APPLET CODE="MyApplet.class" ARCHIVE="MyApplet.jar" WIDTH=400 HEIGHT=300></APPLET>

  • ClassNotFoundException using Packages / JARs

    I have a program that I wrote that is essentially a remote desktop connection, except that it can control any number of computers that connect to the server program. It simply assumes each computer is setup exactly the same and only uses a screenshot feedback from one of the computers. The following files are involved, and all located in the same directory "RemoteControl"
    Directory: RemoteControl
    RCServer.java   - The server program
    RCClient.java   - The client program
    Resolution.java - Object containing information about the client's resolution
    ScreenShot.java - Object containing a Screenshot of the client's computer
    MyAction.java   - Object that dictates what action needs to be performedWhen the client connects to the server, the server writes a blank Resolution object to the client, which the client completes and sends back to the server. Outside of a package/JAR file, everything works just fine. However, when I add the line
    package RemoteControl;To each of the files above, compile them, and create 2 jar files like so:
    jar -cmf0 manifest.txt RCClient.jar RemoteControl
    jar -cmf0 manifest.txt RCServer.jar RemoteControlWith the manifest containing:
    Main-Class: RemoteControl/RCClientWith the blank line at the end (replace RCClient w/ RCServer when creating the server jar file), the server program starts up just fine, and so does the client portion. However, when the client actually connects to the server, and the server writes the Resolution object, I receive a "ClassNotFoundException". I extract all the files from the newly created JAR files (jar xf RCClient.jar/RCServer.jar) and they contain all the necessary files (and both JARs are identical with the exception of the manifest data).
    Looking at the stacktrace, the only line number it gives (rest are all Unknown Source/Native Method) points to the middle line in the following:
    System.out.println("starting thread loop - before reading object");
    Object tmp = in.readUnshared();
    System.out.println("object was read");And the console output stops at "starting thread loop - before reading object" before printing the stacktrace. Incase needed, in.readUnshared(); is an ObjectInputStream.
    My initial guess was something to do with resources in a JAR file, since in the past, I've had to use "getClass().getResource("images/gifIcon.gif");" to get an image within the JAR file to load during the application, however my research has told me all class files within the JAR are automatically loaded (assuming they are in the same directory at the main class), and that the Class-Path line in a manifest is only needed when you try to access classes within other JARs.
    Any ideas?
    Thanks in advance.
    Brad

    Here's the output from "jar -tf RCClient.jar"
    META-INF/
    META-INF/MANIFEST.MF
    RemoteControl/
    RemoteControl/BGPanel.class
    RemoteControl/Client.class
    RemoteControl/images/
    RemoteControl/images/gifIcon.gif
    RemoteControl/MyAction.class
    RemoteControl/MyAction.java
    RemoteControl/RCClient$1.class
    RemoteControl/RCClient.class
    RemoteControl/RCClient.java
    RemoteControl/RCServer.class
    RemoteControl/RCServer.java
    RemoteControl/RCServerGUI.class
    RemoteControl/Resolution.class
    RemoteControl/Resolution.java
    RemoteControl/ScreenShot.class
    RemoteControl/ScreenShot.java
    RemoteControl/ShowMessageListener.classAnd the output from "jar -tf RCServer.jar"
    META-INF/
    META-INF/MANIFEST.MF
    RemoteControl/
    RemoteControl/BGPanel.class
    RemoteControl/Client.class
    RemoteControl/images/
    RemoteControl/images/gifIcon.gif
    RemoteControl/MyAction.class
    RemoteControl/MyAction.java
    RemoteControl/RCClient$1.class
    RemoteControl/RCClient.class
    RemoteControl/RCClient.java
    RemoteControl/RCServer.class
    RemoteControl/RCServer.java
    RemoteControl/RCServerGUI.class
    RemoteControl/Resolution.class
    RemoteControl/Resolution.java
    RemoteControl/ScreenShot.class
    RemoteControl/ScreenShot.java
    RemoteControl/ShowMessageListener.classShortly after posting this question, I removed all the package declarations and deleted the class files and recompiled and I started getting the NoClassDefFoundError even though the .class file was in the same directory (not using a jar at this point), so I decided to revert back to earlier versions of the files above. When I compiled them and successfully ran them, I repeated the steps outlined in my OP and it started working, even within a JAR file. So, sadly I cannot provide a stacktrace anymore, but my problem's somehow solved.
    Note: The JARs that weren't working had the same output as above, which leads me to believe...
    Other than missing a few JOptionPane debugging prompts, the only possible difference I could think of is perhaps the Resolution object the server and client were using, were in different packages (or more specifically, one was in a package, one was not). Even though I did exactly the steps in my OP, I'm not going to rule out a possibility that somewhere, something wasn't over-written like it was supposed to (since I was compiling both the java files and the jars w/o deleting any previous .class/.jar files).
    And thanks for both the hasty reply, as well as informing me about the -tf option, that's a bit quicker than extracting the files and looking at the structure myself.

  • Applet that uses Borland package

    Hi!!!!!!!!
    First of all i wanna say that this same topic is published in "Java Development Forum".
    I use JBuilder as IDE and i developed an applet that uses XYLayout.
    xylauyout is included in jbcl package. The import sentence is like this:
    "import com.borland.jbcl.layout.*; "
    When i try to run the applet from a browser, it throws an error. It refers to this package.
    The question is: how can i "tell" the browser to "look-up" the Borland's library i use? What should i do??
    Bye
    PS: sorry for my english!!

    I didn't understand what to do. I mean, i created a jar file that includes jbcl, but i don't know what to do??
    Here's the code of the HTML:
    <html>
    <head>
    <title>
    HTML Test Page
    </title>
    </head>
    <body>
    pruebaapplet.DataEntry will appear below in a Java enabled browser.<br>
    <applet
      codebase = "."
      code     = "pruebaapplet.DataEntry.class"
      archive  = "PruebaApplet.jar"
      name     = "TestApplet"
      width    = "600"
      height   = "500"
      hspace   = "0"
      vspace   = "0"
      align    = "middle"
    >
    </applet>
    </body>
    </html>PruebaApplet.jar is in the same directory of the html. The directory pruebaapplet is also situated in the same directory. DataEntry.class is inside pruebadataentry directory
    What should i do??????

  • Run applet that uses borland jar's

    Hi!!!!!!!!
    I use JBuilder as IDE and i developed an applet that uses XYLayout. The problem i'm having is that the browser (MS Internet Explorer and Netscape) throw the same error and that is the package i used.
    How could i configure it???
    P.S. : sorry for my english!!!!!!!!!!
    Bye

    I'm writing this message again because i wasn't clear enough. I use a jar provided by Borland JBuilder:
    " com.borland.jbcl.layout.*; "
    This library isn't provided by Sun, so the when i try to run the applet from a browser, it throws an error.
    The question is: how can i "tell" the browser to "look-up" the Borland's library i use?
    Bye

  • Modifying JAR file using java.util.jar package  over the network

    Hello,
    I am modifying a JAR file programmatically using java.util.jar package. The time taken to save the contents to a local disk is very less (around 1 sec) . When I tried modifying the JAR from a remote machine over the network (from mapped drive or shared folder of WIN NT), the time taken to save is 15-20 times more.
    I am recreating the whole JAR while modifying. Is there any way to improve the performance. Or is it possible to write only the changed files?
    Thanks,
    Prasad Y S.

    When you "update" a jar file, you must always recreate it from scratch.

  • Packaging JAR's using Ant in Eclipse

    Hey,
    I'm new to Ant, and xml for that matter. I need to rmi compile & package a set of simple classes whose objects call eachother remotely. I need seperate jars for a "server" and one for "client" containing whatever classes are needed for each. Using Ant the classes should be compiled, packaged into the jars and then the jars should be copied to some other specified directory. And of course, the jars should be executable.
    The files I use are AddressBook (interface extends Remote), AddressBookImpl (extends UnicastRemoteObject implements AddressBook), BuddyInfoInterf (interface extends Remote), BuddyInfo (the implementation, extends Unicast... implements BuddyI...), and AddressBookUser.
    The AddressBook is created on the server-side (in main() found in AddressBookImpl) and is populated with BuddyInfo's also created server-side.
    AddressBookUser is just the client accessing some info from ABook or BInfo.
    So, anyway, here's the xml file I've written to do the tasks assigned. The classes compile fine, and the jar files seem to contain the proper files. My problem is that the jar files don't execute properly. The main() in AddressBookImpl creates the ABook and binds it to the rmiregistry. When I run the server.jar that is "initially" created during the process (the one in the base dir) it works fine but this only seems to work correctly because it's in the same dir as all of the compiled classes. The copied jar file in the other directory, or even if I manually copy the server.jar file in the base dir to some other dir, causes an exception when trying to bind the AddressBook to the registry saying it can't find a stub that is definitely located in the jar. And I'm running the rmiregistry in whatever dir the server.jar is in each time:
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
    server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: AddressBookImpl_Stub
    at sun.rmi.server.....
    <?xml version="1.0"?>
    <project default="packaging">
    <!-- Change location(s) to desired path(s) where client and/or
    server jar files should be copied to, else will create folders
    "client" and "server" in project directory and copy them to
    there. -->
    <property name="serverDir" location="./server"/>
    <property name="clientDir" location="./client"/>
    <!-- performs all tasks -->
    <target name="packaging">
         <!-- Compiles all files in project directory. Necessary for
         AddressBookUser.java to be compiled -->
         <javac srcdir="."/>
         <!-- RMI compiles AddressBookImpl & BuddyInfo -->
         <rmic classname="AddressBookImpl" base="."/>
         <rmic classname="BuddyInfo" base="."/>
         <!-- Creates server jar file -->
         <jar destfile="./server.jar" basedir="." includes="**.class" excludes="AddressBookUser.**">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookImpl"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- Creates client jar file -->
         <jar destfile="./client.jar" basedir="." includes="**.class" excludes="AddressBookImpl.** BuddyInfo.** **Skel.class">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookUser"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- copy jar files to specified directories -->
         <copy file="./server.jar" todir="${serverDir}"/>
         <copy file="./client.jar" todir="${clientDir}"/>     
    </target>
    </project>
    Sorry bout the length. Just want to cover my bases. Thanks for any help.

    I am also having problem in building server.jar file using Ant. I am using EJB jar file in my web application, this jar file is called remotely from server to client. Client.jar file working correctly but the server.jar file contains error which is given below:
    15:30:47,296 WARN [verifier] EJB spec violation:
    Bean : Server
    Section: 22.2
    Warning: The Bean Provider must specify the fully-qualified name of the Java cla
    ss that implements the enterprise bean's business methods in the <ejb-class> ele
    ment.
    Info : Class not found on 'com.ejb.ServerBean': No ClassLoaders found for: com.ejb.ServerBean
    15:30:47,296 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.GA/server/default/deploy/server.jar
    org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
    In above error, "Class not found on 'com.ejb.ServerBean' " is given. Will there be all the classes of EJB jar file in server.jar ? I think only the interface class file i.e. Server.class and serverHome.class must be included, am I correct or not?
    Also the build.xml which I am using for creating server.jar is given below:
    <project name="ServerEJB" default="make_server_jar" basedir=".">
    <!-- Initialization variables -->
    <property environment="env" />
    <property name="app.name" value="${ant.project.name}"/>
    <property name="source.dir" value="ejbModule"/>
    <property name="build.dir" value="build"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="distribution.dir" value="dist"/>
         <property name="server.ejb.jar.name" value="server.jar"/>
    <target name="clean" description="Deletes compiled and generated code">
    <delete dir="${build.dir}"/>
    </target>
    <target name="make_server_jar" depends="" description="Builds a server.jar with stubs for apps to use">
    <mkdir dir="${distribution.dir}" />
    <jar destfile="${distribution.dir}/${server.ejb.jar.name}" basedir="${classes.dir}">
         <exclude name="**/*Bean.class"/>
    </jar>
    </target>     
    </project>
    I am using server.jar file in server as interface which will remotely call client.jar which will be kept at client location.
    Anybody, can you provide me with the solution for this problem?...
    Thank you.

  • In 7u51, will all jars referenced by the applet need to be updated to include the Permissions Manifest attribute ? Or, will it be limited to the jar that contains the applet code ?

    To whom it may concern,
    According to Java RIA checklist(http://www.oracle.com/technetwork/java/javase/overview/ria-checklist-2055184.html),
    as of 7u51(January 2014), Permissions Manifest attribute in main JAR file will be required.
    But, at least, as of 7u45, when the Security Level slider is set to Very High,
    a jar without Permissions Manifest attribute, which doesn't contain the applet code but is just referenced by the applet,
    prevent the applet from running.
    So, the question is:
    In 7u51, does it mean that all jars referenced by the applet need to be updated to include the Permissions Manifest attribute ?
    Or will it be limited to the jar that contains the applet code?
    There is a concern that we will have to modify library jars that we do not control.
    Sincerely,
    Toshio Shiko

    Thank you for your quick response and your investigation!
    It do help us very much.
    But, unfortunately, for the moment, I'm not allowed to test the early access version.
    As soon as circumstances are changed, I' d like to test it.
    Again, thank you for your providing of the useful information.

  • I changed my AppleID a long time ago to an email that I no longer use and I have updates for apps that I can't update because my old email is filled in to where i sign in and it wont let me change it to my new one???

    I changed my AppleID a long time ago to an email that I no longer use and I have updates for apps that I can't update because my old email is filled in to where i sign in and it wont let me change it to my new one???

    The problem with those two apps is that they are supposed to be in your Apple ID and you didn't set up the Mac properly/completely when you got it.
    You might try deleteing them and using OS X Recovery to install them again.
    OS X Recovery -
    http://support.apple.com/kb/HT4718
    After that, before you open any iLife apps go to your Mac App Store account, to the Purchased pane and Accept them into your account.

Maybe you are looking for

  • How do I move or delete App icons from my screen?

    I'm tryng to eliminate most of the icons on my phone screen.  On my 4, I used to be able to do it by holding my finger on the icon and either editing or just moving.  But I can't move anything to page 2 of my screen and page 1 is full.  HELP

  • Asset Number Logic

    HI all, I am giving the Asset number . from i  need invoce number. after that i have to retrive the Doucment number and and PO number . Please help in this. regards, Ram

  • Manager Manager and Prompt Manager going out of service

    Hi, I have set up RTMT to email me syslogs so I can see if there is a problem with UCCX.   Whenever I upload a new prompt or create a new folder I am seeing error messages saying that Manager Manager and Prompt Manager are in partial service. But whe

  • SBSH Calendar Pro public beta released - available for free download!

    Hi all! We've just released our first version of SBSH Calendar Pro, initially released today as public beta and available for free download to all users!  In a nutshell, the goal of Calendar Pro is to offer a powerful personal information manager (PI

  • Where is the DLL file that exports these functions?

    I have been tasked with controlling a DAQCard E-series via program written in C. My development environment is MinGW on Windows 2000, with DAQ-MX and Traditional installed. I started by using the MX example code as a foundation. Everything goes well