Decompile JAR , Update .Class file , Compile?

Is it possible to decompile a excutable JAR file, update the .class file and compile it again?
I'm using DJ Decompile software.
Need your expertise.. =P

Well, you wouldn't decompile the jar. You'd basically just unpack it, and then you'd decompile the classes inside it, and then you'd update the .java file, and then recompile the source code files and repackage it into a new jar.
But otherwise, yes.
There may be a variety of better options though. For example, maybe you could create a single new class that replaces or wraps a single class in the jar, and then create a new manifest file with the Main-Class attribute pointing to your new class. Or with any luck you could get the original source code. Etc.

Similar Messages

  • Deploying application with class files compiled using ojspc

    Hi,
    I want to deploy the application having class files compiled using ojspc in Oracle9iAS Release 2 rather than having JSP pages.
    Thanks,
    Pritam

    Hi Manoj,
    I have tried doing something like this.
    If you want to try this out running on a NW2004s.You need to first download the entire project from perforce branch (
    tc\webdynpro\clientserver)for NWDS 7.0 and then build the project locally in your java perspective.
    During the local build of the project.It will also point out the dependent projects required by this project(clientserevr).
    Once the project is build.
    Create seperate external jars of the clientserver project and its dependent projects and save them locally.
    Open your SDM manager,pick up this jar file from there and deploy it.
    Once the deployment is over, the server is ready to run the application you created.
    But this make your NWDS2004s to behave jus like NWDS7.0 .
    Just a small suggestion ,instead of going through this tedious process you can shift to NWDS7.0 itself.
    regards
    aarthi mathivanan

  • J2EE .class file compiling for jar, ear files.

    I know that using the former Sun/present Oracle .class java source code compiler,
    I create a platform independet class file which can be used by the java language
    on any OS environment with the appropriate Java Runtime Environment installed.
    I know that there are obfuscation tools available to prevent the .class file decompilation
    related issues.
    I have also been using the GNU gcj compiler with great success. However,
    I havn't been able to find a non-commercial purchase compiler that can create
    .class files, with the same platform independence, but that can't be easily decompiled
    based on the simple content in .class files. Can someone point me to someone on the net
    for a free for commercial development java compiler, past about 1.5.X ?

    If it were possible, don't you think Oracle would have built the compiler like that themselves?

  • 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.

  • 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

  • Updating class file in deployed application in integrated Weblogic of Jdev

    Dear all,
    The Jdeveloper I'm using is version : 11.1.2.1.0
    When I deployed an application and then change the '.jspx' content and save, it will update the file in the deployed application in the integrated weblogic and everything works fine. (I can see the updated immediately without undeploy/deploy the application). When I updated a .java file, after compiling, it will shown the same message saying that the application on the integrated weblogic server is updated too, however, when I try clicking the page, it will show null pointer exception.
    Just hope to ask if manually undeploy/deploy the whole application is needed after updating a .java (class) file or it's just some configuration issue?
    Thanks a lot!
    Andrew

    Hi,
    I've tried to rebuild the whole working space but the exceptions are still exist. The error messages are pasted below for reference.
    So to get the udpated .java (class) to work, I need to 'manually' click on the 'run' command to the task flow file and a 'undeploy -> deploy' process will be done by the jdeveloper (need to wait for a few minutes).
    If no need to (undeploy->deploy), I think I can save many time a day. Anyway, Thanks for all repiles!
    Andrew
    Error Message:
    [05:52:06 PM] Updated /C:/Users/second52/AppData/Roaming/JDeveloper/system11.1.2.1.38.60.81/o.j2ee/drs/TRS_WEB/ViewControllerWebApp.war/WEB-INF/classes
    <ConfigureListener> <contextInitialized> Initializing Mojarra 2.0.5 (FCS b02) for context '/TRS'
    <Feb 22, 2012 5:52:40 PM HKT> <Error> <HTTP> <BEA-101020> <[ServletContext@17528203[app:TRS_WEB module:TRS path:/TRS spec-version:2.5]] Servlet failed with Exception
    java.lang.ClassCastException: oracle.adfinternal.view.faces.webapp.rich.RichWindowManagerFactory$WindowIdProviderAdapter cannot be cast to org.apache.myfaces.trinidad.event.WindowLifecycleListener
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManagerFactory$ApplicationWindowListeners.processWindowLifecylce(RichWindowManagerFactory.java:244)
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager._fireWindowLifecycleEvent(RichWindowManager.java:496)
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager._handleWindowOpened(RichWindowManager.java:539)
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager.renderLoopbackPage(RichWindowManager.java:946)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:110)
         Truncated. see log file for complete stacktrace
    >
    <Feb 22, 2012 5:52:40 PM HKT> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at Feb 22, 2012 5:52:40 PM HKT. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = Feb 22, 2012 5:52:40 PM HKT SERVER = DefaultServer MESSAGE = [ServletContext@17528203[app:TRS_WEB module:TRS path:/TRS spec-version:2.5]] Servlet failed with Exception
    java.lang.ClassCastException: oracle.adfinternal.view.faces.webapp.rich.RichWindowManagerFactory$WindowIdProviderAdapter cannot be cast to org.apache.myfaces.trinidad.event.WindowLifecycleListener
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManagerFactory$ApplicationWindowListeners.processWindowLifecylce(RichWindowManagerFactory.java:244)
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager._fireWindowLifecycleEvent(RichWindowManager.java:496)
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager._handleWindowOpened(RichWindowManager.java:539)
         at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager.renderLoopbackPage(RichWindowManager.java:946)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:110)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = trsenh01 TXID = CONTEXTID = ca100e6c7f7fafe1:-4db71864:135a424c0e1:-8000-00000000000000ce TIMESTAMP = 1329904360140
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000
    >

  • Class File Compilation Version

    Anyone knows how I can see in which version of jdk a class file is compiled?

    The first 4 bytes in the class file are the magic number, ie. 0xCAFEBABE
    The next 2 are the minor number, next 2 are the major number.
    I've a lookup table up to version 1.2 but not beyond that.
    So, assuming these are major & minor number pair ranges...
    ( 0, 0 ) - ( 44, 65535 ) = Unknown JDK, less than 1.0.2
    ( 45, 0 ) - ( 45, 3 ) = Sun JDK 1.0.2
    ( 45, 3 ) - ( 45, 65535 ) = Sun JDK 1.1.X
    ( 45, 0 ) - ( 46, 0 ) = Sun JDK 1.2
    ( 46, 0 ) - ( 65535, 65535 ) = Sun JDK 1.2 or greater
    regards,
    Owen

  • Updated Class files not generated

    Hi ,
    I am using Eclipse SDK Version: 3.2.2 and have configured with my project and weblogic server. When the application is running in debug mode if necessary making some fix and when i use ctrl+b the new class file should be generated and immediately the application should refer to the new class file without expecting to restart the weblogic server.
    But that's not happening, when i do a ctrl+b the class files are cleaned and new class files are not getting generated,moreover this cleaning is also consuming lot of time.
    Can some body help me to resolve this , so that i can save lot of time in restarting the server for every small fix too.
    Regards
    Sathya

    Hi ,
    I am using Eclipse SDK Version: 3.2.2 and have configured with my project and weblogic server. When the application is running in debug mode if necessary making some fix and when i use ctrl+b the new class file should be generated and immediately the application should refer to the new class file without expecting to restart the weblogic server.
    But that's not happening, when i do a ctrl+b the class files are cleaned and new class files are not getting generated,moreover this cleaning is also consuming lot of time.
    Can some body help me to resolve this , so that i can save lot of time in restarting the server for every small fix too.
    Regards
    Sathya

  • Can you update .class files in a running portal instance?

    We are developing with wlportal4.0 sp2/wlserver6.1 sp2 and we're having a problem
    with the .class files which define our custom servlets, tag-libraries, etc. We store
    all of the class files required by the portal under (obviously) the web-apps "WEB-INF/classes"
    directory, following the standard J2EE servlet contract. Everything works fine,
    but if we change one of the .class files while the server is running, no matter which
    .class file it is, we receive a "Webflow Configuration Error":
    Webflow Configuration Error:
    XML File: portal.wf
    Current Namespace: portal
    Configuration Error Message:
    ClassCastException was throw while trying to cast class [com.bea.p13n.appflow.webflow.internal.IPProcessor]
    to [{1}].
    .. Followed by a dump of the pipeline session and the session attributes. The only
    way to get around this we've found is to stop and re-start the portal which, obviously,
    is a pain.
    Has anybody run into this situation and found a workaround?
    Thanks!

    Seeing how your getting an webflow type error. If these classes are inputprocessors
    issue a support ticket about "hot deployments of input processors"
    -Travis
    "Joshua Davies" <[email protected]> wrote:
    >
    We are developing with wlportal4.0 sp2/wlserver6.1 sp2 and we're having
    a problem
    with the .class files which define our custom servlets, tag-libraries, etc.
    We store
    all of the class files required by the portal under (obviously) the web-apps
    "WEB-INF/classes"
    directory, following the standard J2EE servlet contract. Everything works
    fine,
    but if we change one of the .class files while the server is running, no
    matter which
    .class file it is, we receive a "Webflow Configuration Error":
    Webflow Configuration Error:
    XML File: portal.wf
    Current Namespace: portal
    Configuration Error Message:
    ClassCastException was throw while trying to cast class [com.bea.p13n.appflow.webflow.internal.IPProcessor]
    to [{1}].
    ... Followed by a dump of the pipeline session and the session attributes.
    The only
    way to get around this we've found is to stop and re-start the portal which,
    obviously,
    is a pain.
    Has anybody run into this situation and found a workaround?
    Thanks!

  • Getting generated class files using the compiler api??

    I am writing a compiler/IDE for java, and i use the new JavaCompiler API
    (javax.tools.JavaCompiler)
    i want to ask, is it possible to get the generated class file(compiled file) names??
    can anyone help me with this, read at the documentation and i have no idea which one is used to do such thing..
    Or is it impossible??
    Thanks, please guide me on this..

    E.D.-inc wrote:
    I am writing a compiler/IDE for java, and i use the new JavaCompiler API
    don't.
    i want to ask, is it possible to get the generated class file(compiled file) names??
    yes, probably (after all, other tools can do it). Don't ask me how though, I've never had a need to.
    can anyone help me with this, read at the documentation and i have no idea which one is used to do such thing..
    no. Someone else reading the documentation for you won't help you any. Read it yourself, you might learn something.

  • Preventing decompilation of class files

    Hi,
    I tried yesterday running a decompiler on my .class files, and was shocked to see the result - it was amazingly similar to the original code, and very easy to understand...
    Is there any tool or way to prevent using a decompiler on your .class files, or to make sure the results of running one are not clear? Otherwise it seems like you can just as well send out your original source files.
    Thank you,
    Nir.

    "Otherwise it seems like you can just as well send out your original source files."
    Which is something you might want to consider. I doubt you have coded something so extraordinary, that you should have to protect it?

  • Can anyone help me decompile a class file?

    Can anyone pls help me decompile a class file? I've used DJ decompiler and Cavaj decompiler to decompile it but both can't seem to decompile it successfully. How do I attach the class file here? Thanks in advance!

    Oh! Now I get it. So sorry I didnt intend for anybody
    to do something illegal/unethical. I dont know much
    about Java programming since I am very new to this
    language. I didnt know anything about obfuscating
    codes either. The reason why I was trying to
    decompile the said class file is because I wanted to
    check whether the hack program I downloaded ...That is completely contradictory.
    By the way, can you tell me how I can learn Jave programming
    without the aid of a book since I couldnt find one
    yet.Given the eleventy bachillionty kathousand books that exist on java programming, something tells me you haven't looked too hard for one.
    The best non-hard-copy source:
    www.google.com

  • How to convert class file to Java source code ?

    Hi All ,
    Currently am working in Peoplesoft Demo project using java as Plug in.We have only the class files and jar files and we have planned to modify the code for future enhancements.We dont have any legal issues here as we are already working with our client for the original source code.
    Kindly help me out in doing this reverse engineering process.We have come to know the below steps would help us out.Can someone guide us in acheiving this process step by step.Please add your experience here and let us know what are the other steps required ..
    (1)Rename the file from .jar to .zip and extract the .zip file.
    (2)Decompile the desired .class file using 3rd party tool and get .java file.
    (3)Modify the .java file and compile it.
    (4)Now zip the extracted files and rename the it from .zip to .jar.
    We need to verify whether the modified .jar file will work
    Thanks & Regards
    Kar1983

    Thanks for your reply ....We have asked them so many times ..but they say they dont have it .Since we have planned to do some enhancements from our end we have planned to do reverse engineering process.

  • Back to .class file

    hello all,
    I'm not big into java yet, but I have a script I'm playing around with that I decompiled from a .class file and moved things around a bit... now I want to compile it back to a .class file and have no idea how. I can't seem to find a freeware program to do it with.
    please excuse my newbiness...
    thanks for the help
    ziggy

    Start with this tutorial http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
    Do not skip anything, and be sure to read the Installation Instructions (there's a link), especially #5, and set the PATH variable as instructed.
    It will lead you through installing and learning to use the compiler, then running a program.

  • Building Encrypted Class Files

    I would like to know if a Java file can be compiled in such a way that it can't be decompiled? Using a decompiler, any Java Class file can be decompiled, thus revealing the source code. But I have seen some Java Class files that when decompiled, gives encoded characters, instead of the text. So, the source code cannot be seen, but can be executed. How is this achieved? Is there some way to encrypt the class file, and still keep it executable?
    Thanks,
    TechnoSam

    Use a code obfuscator. This makes it harder to read, but
    it can still be decompilet. Since Java is compiled into
    bytecodes, all you need to do is translate the bytecodes
    back into source code in order to see the "source".
    When you get right down to it, any program written
    in any language can be decompiled. Microsoft used to
    ship a program named 'debug' with DOS. This program
    allowed you to decompile .exe files.
    Mark

Maybe you are looking for