Same source always makes same .class file ?

Compiling same source code will result always in same .class file ? (off course using the same compiler).
I've seen a site that says the compiler puts a timestamp in the class file. So compiling again at a different time will not result in same .class file.

_cristi_ wrote:
I have tested, so far class files seem to be identical.
But in a large project there might be cases when they differ, that's why I've asked, I can't be 100% sure based on a few tests.
Certainly won't be based on timestamp then.
I need this to extract only the class files that have been changed in order to deploy them.
There is a jar compare tool out there that first decompiles the classes and then compares the resulted text. They say this is necesarry because of timestamp in class files. Link: http://www.extradata.com/products/jarc/
I suggest you ask them to document the claim about the timestamp. They are selling a product and thus the bias can be questioned.
And that sample diff they provide is absolutely pointless because 1.5 versus 1.4 is guaranteed to be different because of the class version difference.

Similar Messages

  • How to hide the source code from the .class file

    Hi,
    By some jad tool we can recompile the .class files and get the java file corresponding to it. How to protect it?
    Anyone please help me..
    Thanks & Regards,
    N.Ravasankar

    An obfuscator can for example rename classes, variables to meaningless names, like one-letter names. And it can make some bytecode that is hard to decompile or just makes the code less readable when decompiled. Some obfuscators might even be able to do something to the code that makes decompilers not work or incorrect decompile code.

  • Can I make my class files executables on Windows platform?

    I have got a very interesting java program, which I have already compiled into a class file. What I want to do now is to make the bytecodes into an executable file on Windows, like any other .exe files. If possible, how do I do that? Will anyone be able to help me with the question?
    Thanks a lot in advance.

    hi,
    you can do it within a jar-file (don't ask me how, but its possible to execute jars)
    or you write a c/c++-program, which will launch you jar
    regards

  • Can we make the .class file into executable one? Urgent

    I just made some java programs, which consist of some GUI and robot, and I need to make them into executable file, mean .exe file. From this forum, there was a suggestion to use Excelsior JET that can make .class files into .exe files.
    and when I tried to use the program, it did the job well, but when I try to put the .exe file into another PC, it can not run as if I run it on the system that I made the .exe file.
    Is there anyone experience this before? is there other solution? and is the the .exe file that has just been generated already include all .class file that are needed by the main .class file that has been converted into .exe?
    Thnks for the helps...

    It is sort of possible.
    A good way of doing this is to use an application called Install Anywhere. With this, you can create an installation file for your application, and it does create an executable. Ive used this a few times myself, and it is really easy to use.
    I think another app to do this is one called JToExe (i think), and this basically creates an executable.
    I hope this helps,
    Osh

  • How to make the class files to run in a particular platform only

    Class files which are created from the java files should only run on a particular platform only..say i'm going to create the class files for windows environment then those class files should only run on that environment only. it should not run on unix environment etc..how to do this..

    hi,
    i cant think of a reason why you would do something like that.. You cant prevent your class files to be read by the JVM of a different OS, but anyway you could do something to stop your code from running in a different OS, for eg.
    Properties prop = System.getProperties();
    if (prop.getProperty("os.name").startsWith("Windows")==true)
          //code
    else
           System.out.println("Sorry i will not run in this OS");
    }cheerz
    ynkrish

  • Quicktime "Save As Source" ALWAYS Result In Invalid File

    When ever I try to save a file being played in Quicktime 7.0.1 PRO on a web page, the resulting file (although the correct size) always results in a corrupt file:
    i.e. "QuickTime cannot open the file "<filename>"
    it is not a file QuickTime understands (-2048).
    This has only started since upgrading to QT7 and it is also applies to Internet Explorer, so I know this is a Quicktime problem.
    If use "Download linked file" in either Safari or IE, the same file plays perfectly. But I can only do this if a link is available and not for an embedded file.
    Can some tell me if there is a way to fix this problem/bug.
    I have kept the system current with Software update.
    Thanks
    Gary

    I upgraded to Quicktime Pro so I could "Save As Source" once the MP3 has downloaded fully into Safari.
    It looks like your question has already been answered, so I will only comment that QT Pro isn't necessary in order to save files like MP3s from web pages. Sometimes it takes a bit of extra clicking around to be able to save files to your hard drive, but right-clicking on a link to a file should bring up a menu allowing you to "Download Linked File." In other cases, the Activity window can be of great help, and so on and so on.
    For what it's worth, downloading your files as I've described will also get around the QT file association issue.
    EDIT: I just took the time to read the link macmenno posted, and I see that Mr. Minow mentions the same approach to downloading linked files from web pages...

  • 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

  • Using same class for duplicate movieclips

    Hello everyone,
    I have created an external class for a particular movieclip and I would like to link a duplicated version of this movieclip to the same class file.
    Problem is I can't seem to do it. Even if I state the class as the BASE class of the new movieclip and create another random class name for it.
    Is there a way I can get around this so I can assign my duplicated clip the same class name ??
    Thanks in advance
    Martin

    well first off I get 'Neutralization of a marked function override' which is apparently caused by the 'stop();' on the first frame of the new symbol.. when I remove that I get 'Number of arguments incorrect.. 2 expected' on the super line
    I have two variables that I'm passing to Animal which are :-
    public function Animal (frameNumber:Number, level:Number)
    Do I need to reflect this in my code ?
    package  {
        import flash.display.MovieClip;
        public class Animal1 extends Animal {
            public function Animal1():void {
                super();

  • Two class files with $ on compile

    Hello friends, I have a simple java program, that consists of two classes, coded in the the same java file.
    One of hte classes extends Thread.
    When I compile the source file, I get one class file for the base class, and two for the other one - ClassName.class and ClassName$1.class.
    Why is the second one created?

    The ClassName$1.class is a class file for an anonymous inner class. You create them with code likebutton.addActionListener(new ActionListener() {
         actionPerformed(ActionEvent ae) {
              System.out.println("button was pressed");
    });This particular example is from the GUI world where event listeners are commonly created using anonymous inner classes. There's a separate file for it just because there's always exactly one class file for each class.

  • How to make netbeans compile files as javac cmd??

    hi all...
    I have a problem running my java code from netbeans, I use netbeans 6.7 with jdk 1.6.0_16 on windows XP
    when i compile the java file in netbeans and then run it, i get an exception but if i compile the same java file using the javac from cmd then run it, everything is perfect without any error.... so i think the problem is from the compiler in my netbeans,
    I want to make the netbeans compiles the java files exactely as javac CMD, and produce the same .class files... how can i do this?
    thank you...

    You should post the error message. Maybe someone can then give you some guidance.

  • How to save library symbols' class files in packages that are not the default package?

    Hi,
    I perform the following in Flash CS5 with Flash Builder 4
    1) Create a new library symbol.
    2) Do a RightClick->Properties on the new symbol
    3) Check the options for "Export for ActionScript" and "Export in frame 1".
    4) I write a new name for my class "Class1" and click on the pencil icon "edit class definition" to edit the class.
    At this point my FlashBuilder 4 takes over and opens the "New ActionScript" dialog.
    4) I then click on Package-Browse to select a package e.g. com.mycompany.myfiles as the new class destination.
    The as file is created as com.mycompany.myfiles/Class1.as as everything seems just fine.
    5) I close the ActionScript file and back in Flash CS5 I RightClick on the symbol and select "Edit Class".
    At this time, FB4 suggests again to create the file, ignoring the fact that I already created it before.
    Do you know of a way I can make Flash CS5 remember where I created the file?
    Thanks.

    Hi,
    I didn't remove the project or delete any of the files.
    All I did was create the class file under a package that is not the default package. Then when I clicked on the Flash symbol's "Edit Class" It asked me again to create the same class file.
    Only if I create the class in the default package, it won't ask me to recreate it again.
    Bye,
      RaamEE-IL

  • How to convert class files into java files??

    Hey Guys,
    I need a little help.
    I want to know wheather we can view .class files as .java files or convert the .class to .java files.Is ther any tool or software for doing that.
    Or in other words can i see the source code of any .class file..??
    Plz do tell me if we can do that or any other way we can do that.
    Regds,
    Gokul

    Sort of. A "decompiler" will take a class file and generate a source code file of source code that could be compiled to get the class file you started out with. However, it won't be the same source code that was originally used to create the class. Most notably, comments will be missing, and variable names will probably be meaningless.
    And before you say "java is bad because you can decompile it", note that any language that you can execute you can theoretically decompile.
    Also, you can view the raw byte codes. If you're familiar with assembly language, or better yet familar with java bytecodes and the JVM in particular, you can often find out what a particular method does just by viewing the byte codes.

  • .Class file comparison

    Is there a tool that can compare two .class files, and/or generate output as to there identities and differences? For example, I compile the same java source file twice, with or without any source changes, generating two .class files. Is there a tool that can tell me the contents of each .class file, and/or compare the contents of each .class file? Thank you in advance for any information on this subject.

    >
    i think he/she means something more high-level than
    file compare..
    like reverse coding the .class file or something. i
    don't know if anything like that exists though..If that's the case JAVAP (Java class file disassembler) might be useful: http://java.sun.com/j2se/1.4/docs/tooldocs/windows/javap.html

  • Problem with:error: java.lang.ClassFormatError: Truncated class file

    Hello, I created an simple applet writing "hello world". Now I would like to add *.class file to my serwer witch I've implemented on microcontroller P89C51RD2BN.
    Serwer is programmed with hex file which is created after compiling C source files. In this case I converted .class file to array in C (using hexedit program). When I am (using IE ) browsing my serwer Html site is loading corectly and *.class file is send from serwer also corectly (define arrays are transfered corectly) but applet is not initiated. When I am runnig Java console I can see this:
    error: java.lang.ClassFormatError: Truncated class file
    When I am runnig the same site with the same class file on my PC everything is ok.
    I would be greatfull for any help. Thx. (sorry for my English :P )

    Not too familiar with native compilation, which I believe you are trying to accomplish here. It would appear that you don't have any problems running your applet, more or less running it after being converted to legacy code. Try the "native methods" forum under "Fundementals/Key Classes", this may be helpful. Sorry for not being too helpful.

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

Maybe you are looking for

  • HELP! Copyright symbol not displaying properly!

    Hi, I just uploaded a site and I have a couple of problems. The copyright symbol on the footer of each page shows up as a diamond with a question mark in it. Then on some other pages, like the FAQs page for example, the bullet symbols are displaying

  • PS3 is making a clicking sound...

    Hi This is my first post as I am new to this website and Playstation 3 so I apologise if it is in the wrong place. I have recently bought a Playstation 3 Slim 320GB model. I load it up fine and it runs smoothly, no problems there. But there is this o

  • Kernel Panic when network cable is plugged in

    Hi everybody! first, sorry for my english - i will give my best =) I have an 1,8 ghz G5 with 2 GB RAM, OS = OSX 10.3.9 It worked well for approx. 3 years. Since 1 week i get a kernel panic (a message appears where it says i have to restart the system

  • Radio - Previously liked songs don't show liked when played again

    Today I liked a song using playlist radio and it added to my Liked from Radio playlist which is fine. Now fast forward 5 hours later that same song came on again still playing on radio and the thumbs up icon didn't show that I previously liked it.  S

  • Album on iOS 7 on iPad air

    i have an album named Just 4 Xmas and this album include songs of various singers . when i go to album tab in music on ipad , the album splits to many parts . Still be a Just 4 Xmas but in different singers . It doesn't occur in ios 6 .i want all the