how to compile with -Xlint in netbeans
-
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.. :^)
-
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.. :^)
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
-
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
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.