Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. how to compile with -Xlint in netbeans

how to compile with -Xlint in netbeans

Scheduled Pinned Locked Moved Java
questionjavajsonhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    flashery
    wrote on last edited by
    #1

    Hello again, its been a while since I post here I am making a Timer application in java. Which shutdown the PC on specified time. My problem is it is showing a warning

    Note: C:\Users\flashery\Documents\NetBeansProjects\Timer\src\MainTimer.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

    How do I do this recompiling? Can someone give me a hint on this thing.. :^)

    L 1 Reply Last reply
    0
    • F flashery

      Hello again, its been a while since I post here I am making a Timer application in java. Which shutdown the PC on specified time. My problem is it is showing a warning

      Note: C:\Users\flashery\Documents\NetBeansProjects\Timer\src\MainTimer.java uses or overrides a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.

      How do I do this recompiling? Can someone give me a hint on this thing.. :^)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Just add that option to your javac command, or project options in NetBeans. Alternatively find the deprecated method you are calling and change it for the latest version; the documentation will tell you how. BTW the link in your title links back here.

      Unrequited desire is character building. OriginalGriff

      F 1 Reply Last reply
      0
      • L Lost User

        Just add that option to your javac command, or project options in NetBeans. Alternatively find the deprecated method you are calling and change it for the latest version; the documentation will tell you how. BTW the link in your title links back here.

        Unrequited desire is character building. OriginalGriff

        F Offline
        F Offline
        flashery
        wrote on last edited by
        #3

        Thanks Richard MacCutchan it really helps me. For those who don't know here's the details It's just for NetBeans IDE 7.0.1 I don't know how to do it on other IDE. 1. Right click on your project you can see it on the left side of the IDE project tab and select properties. 2. In the project property window just click compiling on the left side of the window. 3. Find this option after clicking the compiling "Additional Compiling Options:" it is located on the lowest side and add your compiling option in my case I add this on the textbox.

        -Xlint:deprecation

        4. Click OK and your done. 5. Try debugging your project and your will see a message like this on the output option of debugging.

        C:\Users\flashery\Documents\NetBeansProjects\Timer\src\MainTimer.java:93: warning: [deprecation] disable() in javax.swing.JComponent has been deprecated
        cmbTime.disable();
        C:\Users\flashery\Documents\NetBeansProjects\Timer\src\MainTimer.java:190: warning: [deprecation] disable() in javax.swing.JComponent has been deprecated
        cmbTime.disable();
        C:\Users\flashery\Documents\NetBeansProjects\Timer\src\MainTimer.java:206: warning: [deprecation] enable() in javax.swing.JComponent has been deprecated
        cmbTime.enable();

        Hope this helps. I really google it and there's no detailed info on how to do it. I am thankful to Richard MacCutchan for saying its on the project option.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups