Jarring and unjarring files at runtime.

I have this line
Runtime.getRuntime().exec("jar -x foo.jar");which hangs.
I wanted to dynamically jar and unjar files.. Can I do this with Runtime.exec()?

Umm..
It took some fiddling for me to realize that I have to have my class file in the directory where I want the extracted files to be for those files to be unjarred in the right place, which then created this problem during rejarring, where my class file gets jarred into it... how can I
a) exclude my class file from being jarred? OR
b) remove auto.class after the jar file is created?
If I knew it was this much of a pain, I would've done it manually :D

Similar Messages

  • Java - referencing external jar and class files

    When compiling (loadjava) a Java class, how can an externally referenced '.jar file' be resolved please? Using '-resolve' doesn't do the job in this case.
    Many thanks.

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • Java classes in Jar and Cab files

    Hello all,
    Our product supply java classes in Jar and Cab files that the browser downloads each time.
    The files are big and it takes a long time.
    Do you know of a way to make the cab/jar files be copied in to the user computer and that the browser would know to download files again only if there is a new version (otherwise take it from the local computer)
    Please help me
    Tamg

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • How to install the struts-el jar and tld file

    How can i install/configure the struts-el jar and struts-logic-el.tld. When I tried with the related sites, i couldn't get any jar files for struts-el tag.
    I got only 404 status error.
    From where and how to get the jar file and tld file for the struts-el tag .Please refer me

    The jar file is part of the download of struts.
    its in the /contrib/lib directory
    You should need struts, jstl plus the struts-el jar files.
    The tld files should not be necessary - just use the standard URIs for them.
    eg http://struts.apache.org/tags-logic-el

  • Problems with libs in jar and .bat file

    I have a third party library in a jar, let's say LIBRARY.JAR. Then I have my program which uses classes in that Jar, let's call it Program.JAR. The main class is program.Main.class. And I want to write a batch file so that it set's the classpath ro the LIBRARY.JAR, and runs program.Main class. Could anybody help me? I can't manage so far...

    For Windows the batch file could containjava -classpath LIBRARY.JAR;Program.JAR program.MainFor *nix, use : instead of ;                                                                                                                                                                                                                                                                       

  • Trouble installing jar and jad files on E62

    hi i use a nokia E62 device and i am not able to install any jar or jad file on it. i am able to instal all sis and sisx applications without any trouble.it gives an error-unable to install when ever i try to install any jar file.
    please please urgent help required any sort of help would be apprecatd

    Hi can yo tell me how to get jar/jad.pls

  • JAR and UNJAR

    I don't know how to JAR, UNJAR a file?why we are using this technique?I need more information about this.

    As the fellow posters mentiioned, a JAR file is an archive holding all your application data.
    As a big advantage, dou dont need to cope with several classpaths to set or access problems regarding resources spread in your file systems
    You can just call your app with the java -jar option to run it.
    Additionally, trust establishment with jars is only possible (and easier) using jar files.
    If you are writing applets you can put everything inside the jar file withtout the need for classpath or codebase problem related to it, the applet is loaded as a whole instead of loading lots of scattered class files. Though this does prevent from loading class files on demand only, the overall loading process is much faster.
    Summarizing, using jar files makes software deployment much easier.
    Oliver

  • How to read jar and jad file

    hi friends...
    i have download some jar files now i want read this jar file means i want read all classes or files which r using in that project..
    is there any software to which extract that jar file..
    plz anyone know this thing plz help me....
    thks in advance..
    Thanks and Regards
    Prashant

    Just rename the jar to .zip. The jad is just a text file.

  • Jars and .class files - security of the source code

    Hi,
    I have an app that is in a jar file with the .class files (so no source code).
    I'm wondering how difficult it is to attain the source code from these .class files in my jar? Looking through the contents of the .class files it seems there is a large amount of readable text. For example I see method names, variables, etc.
    This leads me to believe these jars are not secure. What is a better way?
    Thanks!
    Edit:
    Looking around, I've noticed many java decompilers and Sun even supports a dissembler - javap. I think this is not cool, haha.
    What way can I protect my code? To me, the value of java just went way down due to the ease at attaining source code (based on what I read in the past hour or so. I have yet to try it myself). I wonder if this impacts companies reasons not to use java?
    Edit 2:
    I heard that there may be a way to make the jar closed, so you can't say, use winrar, to extract the class files. Does anyone know anything about this?
    Message was edited by:
    dayrinni
    Message was edited by:
    dayrinni

    Hi,
    I have an app that is in a jar file with the .class
    files (so no source code).
    I'm wondering how difficult it is to attain the
    source code from these .class files in my jar?
    Looking through the contents of the .class files it
    seems there is a large amount of readable text. For
    example I see method names, variables, etc.
    This leads me to believe these jars are not secure.
    What is a better way?
    Thanks!
    Edit:
    Looking around, I've noticed many java decompilers
    and Sun even supports a dissembler - javap. I think
    this is not cool, haha.
    What way can I protect my code? To me, the value of
    java just went way down due to the ease at attaining
    source code (based on what I read in the past hour or
    so. I have yet to try it myself). I wonder if this
    impacts companies reasons not to use java?All intellectual property stored in electronic form is vulnerable. Not just Java bytecode. You can use tools called obfuscators to make decompiling more difficult, which is usually good enough. The truth is, no matter how great you think your code is, it's of a lot less interest to others than you actually think. Unless you've got a particularly sexy argorithm or something, it's not really worth worrying too much about
    All you can do is make it more difficult for people to crack things, never prevent it. True of all languages, all electronic media

  • Problems with JAR and manifest files

    Hi
    I have a simple class MyClass.class (not in a package) which contains:
         public static void main( String[] args ) {
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                               public void run() {
                                   new MyClass();
         }and a manifest file Manifest.mf which contains:
    Manifest-Version: 1.0
    Created-By: 1.4.2_08 (Sun Microsystems Inc.)
    Main-Class: MyClassand i am using the following line to create a JAR file:
    jar -cvmf Manifest.mf  MyClass.jar MyClass.classHowever when I try to run the file I get the following error:
    Could not find the Main file. Program will exit

    And another one
    although this one has an answer it doens't solve mine (I have a line at the end of my manifest)

  • How to Transfer my Jar and Jad file to my Mobile (Samsung D500)

    {color:#800000}*Hi*
    I am an ameture programmer. I have developed some MIDlets using netbeans 5.5 and now I have to load it to my mobile using BLUETOOTH...
    If anybody know how to do it please help....
    my mobile model is Samsung D500...
    Thanks{color}

    Google for it: install jar Samsung D500
    http://www.google.com/search?q=install+jar+Samsung+D500&start=0&start=0&ie=utf-8&oe=utf-8&client=mozilla&rls=org.mozilla:en-US:unofficial

  • My .jar and .jad files are not launching

    Hello everyone! I have a problem with my files stated above. I am unable to open them. I see a yellow key at the top right corner on the icons. I Have checked them. They don't have QT errors either. I have gone through the D and Z drives by Xplore but i don't recognize anything that might be the cause of the problem. Does anyone have a solution?

    You might wish to tell:
    - Which phone model you have.
    - Which Symbian version is on the phone (if several/different versions supported, such as Symbian^3, Anna, Belle)
    - Are the Java apps developed by you, or if you downloaded them from somewhere
    - Did they end up on your phone via a browser download, Nokia/Ovi Store download, or from a PC using Bluetooth or USB

  • Where do I deploy my jar and jsp files in iplanet server directory ?

    I am new to iPlanet webserver , we are using version 6.
    can anyone give me brief explanation to this. Thanks.

    Hi,
    Please follow the below steps for running JSP & Servlet in iWS6.0
    What Does the Server Need to Run JSP.
    iPlanet Web Server 6.0 includes the Java Runtime Environment (JRE) but not the Java Development
    Kit (JDK) due to licensing restrictions.
    The server can run servlets and precompiled JSPs using the JRE, but you need the JDK to develop
    new JSPs or to deploy uncompiled JSPs.
    Configuring JRE/JDK Paths.
    <b> To specify the path to the JDK.</b>
    1.Switch to the Web Server Administration Server.
    2.Click the "Global Settings" tab and select "Configure JDK/JRE Paths".
    3.Specify the path to your JDK. This is the path up to the level where the bin, lib, etc.
    directories exist.
    <b>Java Server Pages</b>
    Ensure that JSP are enabled.
    Test JSP :
    Open a browser and access your servlet with the following URL :
    http://hostname:port_number/jsp/Helloworld.jsp
    <b> Using Servlet Pages </b>
    Access the Administration Server
    1. Simply start a browser and type the following URL in your browser :
    http://hostname.domain-name:administration_port
    2. You will be prompted for you administrator User ID and Password. Enter
    the correct information.
    3. In order for Servlet to execute properly, there must be a designated Servlet directory.
    By default, "Servlet" is defined within your document root.
    <b> Test Servlet </b>
    Open a browser and access your servlet with the following URL :
    http://hostname:port_number/servlet/HelloworldServlet
    <b>For deploy Webapplications, I hope the below link will help you.</b>
    http://docs.iplanet.com/docs/manuals/enterprise/60sp1/ag/esprgrm.htm#1006308
    http://docs.iplanet.com/docs/manuals/enterprise/60sp1/ag/esprgrm.htm#1004309
    I hope this helps.
    Thanks,
    Dakshin.
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support.

  • How to deploy ear file with jar file and war file with different names

    Hi,
    As part of weblogic migration from WL 6.1 sp3 to WL 10, Iam facing some problem.
    Problem:
    I have one ear file(abc.ear) to deploy which contains one jar file(xyz.jar) and one war file(pqr.war).
    In config.xml file of WL 6.1, it was mentioned as :
    <Application Deployed="true" Name="abc" Path="./config/mydomain/applications/abc.ear">
    <EJBComponent Name="xyz" Targets="myserver" URI="xyz.jar"/>
    <WebAppComponent Name="pqr" Targets="myserver" URI="pqr.war"/>
    </Application>.
    The above is working fine.
    But in config.xml file WL10,I cannot mention the same.
    I need to have different application anmes for ear,jar and war.If I deploy as a ear file,the jar and war files are deployed with the same ear file name.
    I tried the following options:
    1) Deploying as a ear file by adding <sub-deployments>
    2) Deploying both war and jar seperately which is not recommended in my application.
    Please provide the content I should place in the config.xml so that everything works fine correctly.
    Any help is appreciated.

    Hi,
    As part of weblogic migration from WL 6.1 sp3 to WL 10, Iam facing some problem.
    Problem:
    I have one ear file(abc.ear) to deploy which contains one jar file(xyz.jar) and one war file(pqr.war).
    In config.xml file of WL 6.1, it was mentioned as :
    <Application Deployed="true" Name="abc" Path="./config/mydomain/applications/abc.ear">
    <EJBComponent Name="xyz" Targets="myserver" URI="xyz.jar"/>
    <WebAppComponent Name="pqr" Targets="myserver" URI="pqr.war"/>
    </Application>.
    The above is working fine.
    But in config.xml file WL10,I cannot mention the same.
    I need to have different application anmes for ear,jar and war.If I deploy as a ear file,the jar and war files are deployed with the same ear file name.
    I tried the following options:
    1) Deploying as a ear file by adding <sub-deployments>
    2) Deploying both war and jar seperately which is not recommended in my application.
    Please provide the content I should place in the config.xml so that everything works fine correctly.
    Any help is appreciated.

  • Loading .jar and .class in MX7

    I have a cfx tag that includes a .class and .jar file. I
    could do this on the old MX server but in MX7 the option is not in
    the cfide/administrator.
    I copied the .jar and .class files into the
    c:\cfusionmx7\runtime\lib\ directory and then added them to the
    bottom of the jvm.config file with the following entry. (note: The
    .jar file is called MYNEWFILE.jar)
    java.class.path={application.home}/servers/lib,{application.home}/../lib/macromedia_driver s.jar,{application.home}/lib/cfmx_mbean.jar,{application.home}/lib,{application.home}/lib/ MYNEWFILE.jar,{application.home}/../wwwroot/WEB-INF/lib/
    I then rebooted the server. I also have a ".class" file that
    goes with this. I have no idea where to put that thing. The cfx
    (which I mapped in the administrator).
    I get the standard 500 error saying:
    HTTP 500 - Internal server error
    Internet Explorer
    even though I have debugging going to my laptop.
    Here is the output of the exception.log
    "Error","jrpp-0","07/05/07","16:04:14",,"com/allaire/cfx/CustomTag
    The specific sequence of files included or processed is:
    C:\Inetpub\wwwroot\Pauly\example.cfm "
    java.lang.NoClassDefFoundError: com/allaire/cfx/CustomTag
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown
    Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:69)
    at
    coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:207)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at coldfusion.tagext.CfxTag.doStartTag(CfxTag.java:88)
    at
    coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1908)
    at
    cfexample2ecfm2026642798.runPage(C:\Inetpub\wwwroot\Pauly\example.cfm:3)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at
    coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:343)
    at
    coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at
    coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at
    coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:50)
    at
    coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
    at
    coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at
    coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.CfmServlet.service(CfmServlet.java:105)
    at
    coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    "Information","Thread-10","07/05/07","16:14:10",,"Address
    already in use: JVM_Bind"
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at
    coldfusion.server.jrun4.metrics.CfstatServer.run(CfstatServer.java:64)
    Any help would be greatly appreciated, as I've been working
    on this for a while. I couldn't find a solution in the forums so I
    thought I would post. Thanks!
    Pauly

    >> java.lang.NoClassDefFoundError:
    com/allaire/cfx/CustomTag
    Is the CFX.jar in the classpath?
    > The option is not in the cfide/administrator.
    What option? The administrator has several options for custom
    jars, tags, et.
    - Extensions -> Custom Tag Paths
    - Extensions -> CFX Tags
    CF will also look in these directories automatically
    - {cf_webroot}/WEB-INF/classes (for classes)
    - {cf_webroot}/WEB-INF/lib (for jars)

Maybe you are looking for

  • Why did Apple make the new iPod unable to use Griffin iTalk or iTrip?

    I was so disappointed when I upgraded to the new 5th gen. iPod and was unable to use the accessories I purchased for my previous iPod. Am I missing something? What am I supposed to do? Is there an attachment that will make them usable? Why would Appl

  • JAR running error...please help

    I have created a JAR file, which operates on a database platform program. This is located in a different directory to the main java and class files. Directory of the Testing Program to run the DBP program: C:\CRT in which I've stored my test.jar whic

  • Use of filters in views

    Hi, I'm trying to do something but I don't even know if it's possible, since I haven't found anything on the forum/internet... I have a report, but I want to use two different views in the dashboard, one of them must be filtered. For example, I have

  • Purchase requisition commitment

    hi gurus, Is it possible to have commitment cost raised at the time of creating purchase order and no commitment when purchase requisition is raised????? If yes, what will be the configuration that needs to be done? Thanks

  • Can i have abap faq's

    hi ganesh here i required some sap faq's which prepared manually or those who experinced in any interviews