Results 1 to 10 of 10

Thread: Compile with deprecation

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2005
    Posts
    167

    Compile with deprecation

    When I use javac HandleEvent.java, the following message appear. What does this mean?

    Note: HandleEvent.java uses or overrides a deprecated API
    Note: Recompile with -deprecation for details.

  2. #2
    Addicted Member SpS's Avatar
    Join Date
    Jul 2005
    Posts
    201

    Re: Compile with deprecation

    Quote Originally Posted by ychhuong
    When I use javac HandleEvent.java, the following message appear. What does this mean?

    Note: HandleEvent.java uses or overrides a deprecated API
    Note: Recompile with -deprecation for details.
    Messages are self explanatory

    If your program calls any deprecated methods -the compiler displays a warning.

    Most of the new compilers will warn you when a program overrides a deprecated method.

    To get information about each source file's use of deprecated methods, use the -deprecation option of the Java compiler.

    For details of deprecated classes,methods etc go here
    http://java.sun.com/j2se/1.4.2/docs/...ated-list.html
    #Appreciate others by rating good posts !!

    #The Software Peter Principle is in operation when unwise developers "improve" and "generalize" the software until they themselves can no longer understand it, then the project slowly dies.

    #People who are still ignorant of their ignorance are dangerous.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2005
    Posts
    167

    Exclamation Re: Compile with deprecation

    What are deprecated methods?

  4. #4
    Addicted Member SpS's Avatar
    Join Date
    Jul 2005
    Posts
    201

    Re: Compile with deprecation

    Quote Originally Posted by ychhuong
    What are deprecated methods?
    oh cmon...
    http://www.catb.org/~esr/faqs/smart-questions.html
    #Appreciate others by rating good posts !!

    #The Software Peter Principle is in operation when unwise developers "improve" and "generalize" the software until they themselves can no longer understand it, then the project slowly dies.

    #People who are still ignorant of their ignorance are dangerous.

  5. #5
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Compile with deprecation

    Deprecated methods: some methods that sun wants us to stop using, they came up with better replacements, check Java Doc
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2005
    Posts
    167

    Re: Compile with deprecation

    So it means when we see message about deprecated method, we should not use that methods. How can i find the equivalent method of depreated method? If i still using these methods, will it run properly or not?

  7. #7
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Compile with deprecation

    You will find all of that in JavaDoc:
    JDoc
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Compile with deprecation

    10:1 it's Component.show(). Who's taking?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9
    Junior Member
    Join Date
    Jan 2006
    Posts
    31

    Re: Compile with deprecation

    Yap, if I'm not mistaken, deprecated methods can be defined as old methods that have been substituted with other methods. For example:
    Component.show(); is now declared Component.setVisible(true);

    I don't really know, but if I'm not mistaken, it depends on the version of JDK, if u use the older one, u may not find the errors while compiling the program with deprecated methods.
    The only thing for the triumph of evil is for a good man to do nothing

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Compile with deprecation

    Quote Originally Posted by steven_luck1
    Yap, if I'm not mistaken, deprecated methods can be defined as old methods that have been substituted with other methods. For example:
    Component.show(); is now declared Component.setVisible(true);
    No, this is actually incorrect. Deprecated items, in Java, are those whose use Sun discourages, for whatever reason. For example, there are some methods in Thread that are deprecated without replacement, because they can lead to program corruption when used in special circumstances.

    I don't really know, but if I'm not mistaken, it depends on the version of JDK, if u use the older one, u may not find the errors while compiling the program with deprecated methods.
    This is correct, because items only become deprecated when Java releases a new version of the JDK. This doesn't mean, however, that it's acceptable to just use an older JDK: the method is still deprecated, it's just that it is not marked as such and the compiler thus doesn't know it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width