.class and .jar

Hi every one,
In a research lab that i'm working, we're developing a big software. Eventually we are trying to make it destributed.
Our problem is that every time we try to send our updated code to the our clients, we send the library in .jar. Bad thing about .jar is that it can be opened and all .class files can be retrieved which let people see the actual code.
Is there any solution to not let the poeple see the actuall source code???
thanx.

Class files do contain actual bytecode, not just "headers". You can use a decompiler to get a reasonable facsimile to the original Java source code, especially if the Java source was compiled with debugging information.
In order to make decompilation harder, you can use an obfuscator to mangle some of the names the program uses. To make decompilation impossible, you can encrypt the class files using strong encryption and write a custom classloader that will decrypt the class files.

Similar Messages

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • I have J2ME application classes and jar at server, but ............

    Hi All,
    My application is such that some J2ME Applications are loaded in a webserver. Upon the request J2ME should show how many applications are available in webserver and what are they.
    Up to this part i am able to do. I can read the .class or .jar file from my webserver. But my doubt is how i can execute that J2ME application at runtime.
    Thanx in Advance.
    Amarnath Revuri

    Hi john wen,
    1)I am using Wireless Tool Kit 1.0.4 on WinNT
    I have downloaded the midp1.0.3 as u suggested and i read the running.html.
    midp -transient <descriptor URL> [<MIDlet name>]
    this above command you have given is used to run the remote MIDlet at command prompt. But my requirements is i have an J2ME MIDlet already running. In that application there is a situation that i need to get remote application(MIDlet/CAnvas/Form/List etc) stored in my existing MIDlet suite and run it without killing my application that is currently running. Can you pls tell me if you have any idea about this.
    2) Can you tell me how i can access/modify/create a text file in my WinNT system where my MIDlet application is running.
    Amarnath Revuri

  • Wipes out classes and jars in Java Build Path

    Hello!
    All the jar and class files under Library tab gets cleared when I repair my DC project. But when I repair normal projects it does not wipe out  the jars or classes in the Library. Can someone please help me?
    Thanks
    Raj

    Hi Raj,
    The Java build path of a DC-project is based on the definitions in de DC-dependecies (shown in .dcdef file).
    Everytime you repair or build the  DC the build path will be updated into the .project file based on the .dcdef file.
    See the online documentaion for how to add libraries to the DC dependecies.
    Hope this helps.
    Regrads,
    Alain.

  • Applets and classes and jars

    ok, this has probably been asked and answered a million times, but I cannot find it anywhere.
    heres my problem:
    I have an applet and am trying to run it from internet explorer and all I get is a blank screen. the code is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" CONFILTERED="text/html; charset=windows-1252"></meta>
    <title>Segregation of Duties</title>
    <link type="text/css" rel="stylesheet" href="department.css"/>
    <style type="text/css">
    body {
    background-color: #528cff;
    a:link { color: #528cff; }
    <applet code=mypackage.SODApplet.class archive=deploy.SODApplet.jar Height=300 Width=300>
    </applet>
    </style>
    </head>
    <body></body>
    </html>
    Apparently it cannot find the class or the jar. But how do I tell it where to find them?
    The class is in c:/jdevinstall/jdev/mywork/SOD/SODReports/classes/mypackage
    and the jar is in
    c:/jdevinstall/jdev/mywork/SOD/SODReports/deploy/
    the html is on my desktop
    Richard

    Nothing to do with Servlets here... but:
    The Applet JAR has to be in a path relative to the web page, or the server root. You are asking the client (the web browser the user is using) to download the JAR and look inside for the class to run. So the web browser must be able to see that JAR. As such it needs to be in a directory your server hosts. The easiest is to have it in a directory relative to the page that displays it, such as:
    Web Hosted Directory:   C:\Web\HostedDir\
    Web page location                       \MyApp\SODAppletPage.html
    JAR file location                       \MyApp\lib\SODApplet.jar
    Applet tag
        <applet code="mypackage.SODApplet.class"
                archive="lib/SODApplet.jar"
                Height=300 Width=300>
        </applet>

  • Compressing classes and jars using pack200

    Dear All,
    As per the following I expected standalone pack200.exe and
    unpack.exe in J2SDK1.5.0 Beta. But I could not find it.
    http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html#pack200_compression
    Is there any other way to get the standalone above compression tools?
    I want to compress my j2re1.4.2 based application jars.
    Thanks for ur help.
    regards,
    MSKumar

    If you still need an answer to this question, try one of the forums found under Java Technology at:
    http://forum.java.sun.com/index.jsp

  • Adding all the classes and external jars in webservice WAR using servicegen

    Hi,
    Can someone please tell me how do I include all the classes and my external jar files to the ear/war file that is created using servicegen. I don't see any option in servicegen tag where I can include my classes and jar files to the ear/war file. The war it creates only contains the web service implementation class but I want to all the classes in the service code and jars in the same war. Any ideas on how to do that instead of putting in the classpath.
    here is the snippet of my build file
    <servicegen
           destEar="${deploy}/myservice.ear"
           warName="myservice.war">
           <service
             javaClassComponents="com.ws.service.TestService"
             targetNamespace="http://xmlns.test.com/tool/myservice"
             serviceName="myservice"
             serviceURI="/myservice"
             style="document"
             protocol="http"
             expandMethods="True">
           </service>
          <classpath>
            <pathelement path="${classes}"/>
            <pathelement path="${lib}/*.jar"/>
         <pathelement path="C:/bea/weblogic92/server/lib/webserviceclient.jar"/>
          </classpath>      
    </servicegen>
    ..........................Thanks

    Hi,
    The work around I am using to overcome this problem is Unzipping th ear/war file created by servicegen task and including all the classes. Then creating the ear file again by creating a new ant target.
    I know this is not a neater way, but this works for me.

  • How to run .class file and .jar file in jdev9i

    I want to run .class file and .jar file in jdev9i,what should I do?
    Also,I want to generate .class file and .jar file in jdev9i,what should i do?

    Add the .class file containing the public static void main(...) method to the project by clicking on the + toolbar button in the navigator, open the project properties and properly set the additional classpath then right click on the .class in the navigator and say run. It should work, I've just tried it.
    Doesn't work for a .jar yet, in JDeveloper 9.0.3 it works both for .class and .jar
    Michel

  • Load Jar and access a class in jar at run time

    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to Thing
    test.jar contains jartest.class and Thing.class
    jartest1.java
    try{
    File file =new File("test.jar");
    String lcStr ="jartest";
    URL jfile = new URL("jar", "", "file:" + file.getAbsolutePath() +"!/");
    URLClassLoader cl = URLClassLoader.newInstance(new URL[] { jfile });
    Class loadedClass = cl.loadClass(lcStr);
    Thing t=(Thing)loadedClass.newInstance();
    t.execute();
    catch(Exception e)
    System.err.println(e);
    Thing.java
    public interface Thing
    void execute();
    jartest.java
    public class jartest implements Thing
    public void exceute()
    System.out.println("Welcome");
    Thanks and Regards
    V.Senthil Kumar
    Edited by: senthilv_sun on Dec 16, 2008 8:30 PM

    senthilv_sun wrote:
    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to ThingPresumably we can only hope that that is a transciption error. It always helps to use copy and past actual errors and code rather than manually typing them.
    test.jar contains jartest.class and Thing.classWrong.
    The interface class and plugable class must not be in the same jar.
    A plugable interface requires two components
    - Interface (generic sense)
    - Functional components.
    The Interface must be independant (own jar) so that it is available to the framework (user of plugin) and to the functional components. And the plugable component must not be on the java class path.
    This also means that we know for certain that the plugable component is also on the system class path. That is a bad idea as well.
    Given that it is pretty pointless to even speculate as to why this error is showing up. Create the correct jar layout. Test using the command line. Then test using servlets. Insure that the plugable jar is NOT on the java classpath for both tests.

  • 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 modify a class in .jar and compile it back

    Hi,
    I have questions reg .jar, I need to test my application and I need to modify certain files in that .jar and compile it back. How do I do that? I have extract all the classes and decompile it to .java, and I just want to edit just 1 file, but I always have problems compiling it. Am i doing it the wrong way?Please help...
    Thanks.

    Did you make a jar and now need to make changes? Help me to understand why you decomplied the class files? Can you not just make a new jar?

  • Applets and classes in jar files

    I have placed an applet and a group of classes that the applet uses in a jar file.
    The classes are grouped in their own files in a short directory tree within the jar file.
    When the applet is loaded by the browser on a client with the usual CODE="appletname.class" and ACRCHIVE="jarname.jar" statements, are the related class files and the directory tree also loaded into the client? Or do they remain at the server to be used by the applet as necessary?

    I'd say the entire JAR will be downloaded.

  • How to modify a specific class in jar file ?

    I've downloaded a jar file for applet, the jar file works fine... but when I extract a specific class file from the jar file and just recompie it from my IDE (Eclipse) without even making any change and then compress again jar class files including the new modified class file instead of the old one (without any modifications to other classes)... then I get
    (NoSuchMethodError ) exception whenever methods of other classes are invoked from within the modified class !!
    ...The manifist file of the jar file reads the following line
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    I thought it means that jar class files were built using JDK 1.4.0_01 ...I used JDK 1.5.0_01 in my IDE...
    I thought JRE incompatiblity was the reason of the problem so I downloaded JRE 1.4.0_01 and used it to build this class file... but i got the same exception..
    so what is the main reason of the problem ? ...should I make changes to IDX files accompanying applet jar files ??
    If no, then how can I overcome this problem and be able to change and rebuild a specific class from this jar file ?
    (I cannot rebuild all classes in jar because there are errors I cannot resolve !!)

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

  • How to pack .class or .jar with jvm into an exe file?

    In fact, .class or .jar files are middle layer files who need JVM to explain and run them. Sometimes it's unconvenient. Why not provide some tools to pack .class or .jar with jvm into exe file?

    because java should be able to run on any OS. That is why SUN doesn't provide such tool. There are other company's who does provide such tool. Like JBuilder enterprise

  • How to convert .class into .jar file

    Hi,
    How to convert .class into .jar file

    jsf_VWP5.5.1 wrote:
    Hi,
    How to convert .class into .jar fileFrom a command prompt, cd to the location of your .class file(s).
    If you want to create a simple jar, use: jar -cf Whatever.jar Whatever.class
    If you want to compile all .class files in a directory into a jar, use *.class instead.
    Now, I'm going to assume you want to create an executable jar... here's how to do that:
    1) Create a blank text file; for this example, lets call it main.txt.
    2) In the first line of main.txt, type: Main-class: Whatever ('Whatever' should be the name of the class in your program where the main() method is located)
    3) Press enter to go to the next line (someone please correct me if I'm wrong, but if you don't insert the line break/CR after the Main-class: statement, this will not work... in my experience, this is true)
    4) Make sure you save this file in the same directory as your .class file(s).
    5) Type: jar -cmf Whatever.jar main.txt Whatever.class
    ...and that's about it. For more information on the usage of the jar command and to understand the switches (such as -cmf), try jar --help.
    Hope that helps.

Maybe you are looking for

  • PhotoShop Elements 11

    I know I can install PhotoShop Elements 11 and have iPhoto set it as the default editor in Preferences...but I'd like to hear from some who does this...and see if the workflow is OK.  Editing tools in iPhoto and Aperture are not near what they are in

  • Acrobat X Pro - Unable to open the document

    I'm having issues testing Acrobat X Pro trial version and Office 2010 on XP Pro SP3.  When trying to convert a Word document I consistently get the message - Unable to open the document.  Please check to see if you have read permission for the above

  • Why is 10.5.6 put up again last night in the OS X downloads section??????

    Why is the months old 10.5.6 update back up as of last night???? Apple early March 21, 2009 put a months old 10.5.6 update back up.......I installed 10.5.6 months ago..... I called support, and they said it may have some changes to it.....but even if

  • Oracle Portal & 9iAS Database Cache

    Has anyone used Oracle 9iAS database cache to speed up document retrieval from Portal? Can Portal be used to cache Portal documents remotely?? Any help greatly appreciated

  • Howto bind objects to eachother

    Hi, let's say I have two classes, Children and Toys and now I wonder how to bind a toy to a child. A child can have many toys but a toy can only have one owner. class Children{ String name; int age; class Toys{ String name; String desc; What I can th