What's this mean? - "uses or overrides a deprecated API."
Hi, I'm a newbie at Java and I'm getting this error when I try to compile my program:
"Note: C:\MarsLander\NewUser.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details."
I haven't a clue what is going on here, can anybody help?
Methods and classes may get deprecated with the threat that they will be removed form the API in a future version. Deprecated things can be but should not be used.
(Deprecated features can be undeprecated in a future version though. There are at least tow examples for this.)
As the message tells, compile it with the -deprecation flag and the compiler will report which method or class it is about.
Similar Messages
-
Java uses or overrides a deprecated API
Please help on this when this error will occur
when i am compile a JSP Page its throwing an error like this
java uses or overrides a deprecated APIPlease help on this when this error will occur
when i am compile a JSP Page its throwing an error
like this
java uses or overrides a deprecated APIThat's a warning. And it should also tell you what you need to do to get a listing of the deprecated methods that you are using. -
Hi everybody,
when using JCO in UDF I get the error:
<b>MyMapping_.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. 1 error</b>
Does anybody know how to solve the problem?
The problem occurs only when I try to access the tableParameters:
<i> codes = function.getTableParameterList().getTable("COMPANYCODE_LIST");</i>
Regards MarioHi Mario,
With every latest Java version its APIs keep changing and some functions are removed or "deprecated", so if you are getting this error which means JRE you are using not have that function available so compile your code with Java -deprecation to suppress that error.
To check JRE version type Java - version on command prompt and then refer to Java API (also available online) to get detail about that particular function, otherwise you can also chose alternate function to achieve your programming objecting. I prefer if you see JCO API for help on this function.
Refer to sample code : http://www.sapdevelopment.co.uk/java/jco/jco_callfunc.htm
Regards,
Gourav -
Note: ImageViewer.java uses or overrides a deprecated API.
hi,
iam gettin this error after compilation
Note: ImageViewer.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
& am running it on j2sdk1.5.0
Plzzz helpwaoh man......but what 2 look....
heres da code...
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.swing.*;
public class ImageViewer
public static void main(String[] args)
JFrame frame = new ImageViewerFrame();
frame.setTitle("ImageViewer");
frame.setSize(300, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
class ImageViewerFrame extends JFrame
public ImageViewerFrame()
// set up menu bar
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu menu = new JMenu("File");
menuBar.add(menu);
JMenuItem openItem = new JMenuItem("Open");
menu.add(openItem);
openItem.addActionListener(new FileOpenListener());
JMenuItem exitItem = new JMenuItem("Exit");
menu.add(exitItem);
exitItem.addActionListener(new
ActionListener()
public void actionPerformed(ActionEvent event)
System.exit(0);
// use a label to display the images
label = new JLabel();
Container contentPane = getContentPane();
contentPane.add(label, "Center");
private class FileOpenListener implements ActionListener
public void actionPerformed(ActionEvent evt)
// set up file chooser
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new File("."));
// accept all files ending with .gif
chooser.setFileFilter(new
javax.swing.filechooser.FileFilter()
public boolean accept(File f)
return f.getName().toLowerCase()
.endsWith(".gif")
|| f.isDirectory();
public String getDescription()
return "GIF Images";
// show file chooser dialog
int r = chooser.showOpenDialog(ImageViewerFrame.this);
// if image file accepted, set it as icon of the label
if(r == JFileChooser.APPROVE_OPTION)
String name
= chooser.getSelectedFile().getPath();
label.setIcon(new ImageIcon(name));
private JLabel label;
} -
Need help with java uses or overrides a deprecated API.
i have some issues and have not clue where the issue is this is the error that i receive
Note: C:\Documents and Settings\Adam\My Documents\JCreator LE\MyProjects\Pokemon\src\Pokemon.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
here is my codepublic void boundry()
int i;
//System.out.println("y is "+ (y+23) );
//System.out.println("x is "+ (x+17) );
//X10=wall[1].getX();
//System.out.println("wall[1]X is" + X10);
//check to see if over boundary
rightflag=2;
leftflag=2;
downflag=2;
upflag=2;
for(i=0; i<=8; i++)
System.out.println("i is" +i);
//left side
if ( ( (x+17) > (wall.getX() ) )
&& ( (y) < (wall[i].getY() + wall[i].getHeight()-5) )
&& ( (y+23) > (wall[i].getY()+5 ))
&& ( (x) < (wall[i].getX() + (wall[i].getWidth()/2) )) )
rightflag=1;
System.out.println("left");
else
rightflag=2;
//right side
if ( ( (x) < ((wall[i].getX() + wall[i].getWidth() )))
&& ( (y) < wall[i].getY() + wall[i].getHeight()-5 )
&& (y > (wall[i].getY() ))
&& ( (x) > ((wall[i].getX()+(wall[i].getWidth()/2))) ) )
leftflag=1;
System.out.println("right");
else
leftflag=2;
//top side
if ( ( (y+23) > wall[i].getY() )
&& ( (y+23) < ( wall[i].getY() + (wall[i].getHeight()/2-5) ))
&& ( (x+17) > wall[i].getX())
&& ( (x) < (wall[i].getX()+(wall[i].getWidth() ))) )
upflag=1;
System.out.println("top");
else
upflag=2;
//bottom boundry
if(
(y < (wall[i].getY()+wall[i].getHeight() ))
&& (y > (wall[i].getY() ))
&& ((x+17) > (wall[i].getX()))
&& (x < (wall[i].getX()+wall[i].getWidth() ) ))
downflag=1;
System.out.println("bottom");
else
downflag=2;
System.out.println("test");
//stop them from being over boundary
if (rightflag==1)
x=x-10;
else if (leftflag==1)
x=x+10;
else if (upflag==1)
y=y-10;
else if (downflag==1)
y=y+10;
//draw the player
public boolean handleEvent (Event e)
//Get the scroll bars to work
Y2 = indicatestrength.getValue();
Y3 = X2.getValue();
Y4 = Width2.getValue();
Y5 = height2.getValue();
repaint();
return true;
public void save ()
File dataFile = new File ("Users/jeffrey/Server/Test.rtf");
FileWriter out;
BufferedWriter writeFile;
//sample data to write
double testnumber = -34.454;
String testname="this is a string";
try{
out =new FileWriter (dataFile);
writeFile = new BufferedWriter(out);
//write all data as strings
writeFile.write(testname);
writeFile.newLine();
writeFile.write(String.valueOf(testnumber));
writeFile.newLine();
//Close file
writeFile.close();
out.close();
System.out.println ("data written to file");
catch (IOException e)
System.out.println("there was a error writing to the file"); -
What does this mean: -deprecation for details?
hello,i am having a problem viewing this file. whenever a compile it i get this message:
NOTE: Hint1.java uses or overrides a deprecated API.
NOTE: Recompile with -deprecation for details.
can anyone help me what this means? thanks.
here is the file:
import java.awt.*;
import java.applet.Applet;
public class Hint1 extends Applet implements Runnable{
int xPos=2;
Image img;
Thread hint1Thread;
public void init(){
start();
}// end of method init
public void moveCar(Graphics g){
g.setColor(Color.black);
g.fillRect(xPos,50,20,30);
}// end of method moveCar
public void update(Graphics g){
//Captures the graphics image area of 200x200 pixels
img = createImage(200,200);
Graphics gx = img.getGraphics();
moveCar(gx);
//Draws the image
g.drawImage(img,0,0,null);
}// end of method update
public void run(){
while(true){
xPos+=2;
if(xPos>198)xPos=2;
try{
Thread.sleep(50);
}catch(InterruptedException e){}
repaint();
}// end of method run
public void start(){
hint1Thread = new Thread(this);
hint1Thread.start();
}// end of method start
public void stop(){
hint1Thread.stop();
}// end of method stop
}// end of class Hint1[html]
<HTML>
HEAD>
<TITLE>Hint1 </TITLE>
</HEAD>
<BODY>
<applet code="Hint1.class" width=200 height=200>
</applet>
</BODY>
</HTML>
[html]I believ this occured 2 years ago in playoffs. Maybe more. Forget, but the Leafs eliminated Flyers from POffs that year. The Flyers I also don't remember (the one knocked unconscious) but the one that was chasing him around was ... damn ... believe the last name began with an M, he is on the Rangers now... McArthy, thats right! Sandy Mcarthy.
As for Tucker. You are right. Every team needs a guy like him. Flyers have always had 1 or 2. Holding stick, flopping, and stuff. I really don't mind that, everybody does it... I even like Tucker from that point of view (though I hate watching my team fall victem to him :P).
If Quinn hates that style of play, why do the Leafs always rank in top 5 of penalties (the top this year) and among the top in fighting as well? If he wanted it stoppped it would stop. In fact he pushes for it, which you can see by the line match-ups he forces on ice. Also, he does complain a lot, but this is also a tactic. He complains to refs so they watch the other team more closely and will call penalties more on the other team. He does it well. (He is not the only one, Bowman used to do it, and Liniux (sp? does it for the Penquins...). -
Show error overrides a deprecated API ?
hi,
when my java program run, it shows,
Note: D:\javaexample\myJavaPgm.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
what this error message.
Can I ignore this warning ?.
or how can i solve this warning?.hi,
when my java program run, it shows,
Note: D:\javaexample\myJavaPgm.java uses or overrides
a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
what this error message.
Can I ignore this warning ?.
or how can i solve this warning?.Deprecation means a method or class has been identified as obsolete. That means that there is a newer and better alternative to something you are doing. It also means that perhaps one day the deprecated thing will disappear from the API (unlikely probably but could happen).
To solve the warning you will have to find out what it's complaining about.
javac -deprecation myJavaPgm.javaWill tell you what exactly is the problem.
Then you can look in the API for alternatives. -
JRadioButton,ButtonGroup,overrides a deprecated API
Hi guys,
I need to know which JRadioButton is selected in a ButtonGroup. I have to methods to do it. The problem is that I need to communicate this to other class is in other file. I have enclosed a JRadioButton variable in the other class importing javax.swing.*. But I get this warning in that class when compiling.
Note: J:\MainObjectClass.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
1)
public static JRadioButton getSelection(ButtonGroup group) {
for (Enumeration e=group.getElements(); e.hasMoreElements(); ) {
JRadioButton b = (JRadioButton)e.nextElement();
if (b.getModel() == group.getSelection()) {
return b;
return null;
On the other hand, I hava tried a different way, defining the second method. But I get the same warning in the main class now.
2)
public static String getSelection(ButtonGroup group) {
for (Enumeration e=group.getElements(); e.hasMoreElements(); ) {
JRadioButton b = (JRadioButton)e.nextElement();
if (b.getModel() == group.getSelection()) {
return b.getLabel();
return null;
Does somebody what I can do?????
Thanks in advance.If you recompile with -deprecation you see which classes/methods are deprecated and you can use something else. You can also use the deprecated methods, but there's no compelling reason to do so.
-
Error: overrides a deprecated API
Hi:
I get the following error when I try to compile my code:
Note: CalendarTest.java uses or overrides a deprecated API. Recompile with "-deprecation" for details.
1 warning
How do I solve the problem?
Thanks.
Describes a calendar for a set of appointments.
@version 1.0
import java.util.Vector;
import java.util.*;
public class CalendarTest
{ public static void main(String[] args)
Calendar markCalendar = new Calendar("Mark");
Date start = new Date(2003 - 1900, 5 /*June*/, 2, 15, 0, 0);
Date end = new Date(2003 - 1900, 5, 2, 16, 0, 0);
markCalendar.addApp(new Appointment(start, end, "doctor"));
markCalendar.print();
Describes a calendar for a set of appointments.
class Calendar
Constructs a calendar for the person named.
public Calendar(String aName)
{ name = aName;
appointments = new Vector();
Adds an appointment to this Calendar.
@param anApp The appointment to add.
public void addApp(Appointment anApp)
appointments.add(anApp);
Removes an appointment from this Calendar.
@param anApp The appointment to be removed.
public void removeApp(Appointment toFind)
for ( int i = 0; i < appointments.size(); i++)
if (((Appointment)appointments.get(i)).equals(toFind))
appointments.remove(i);
Tests for duplicate appointment dates.
public void dupsTest()
for (int x = 0; x < appointments.size(); x++)
Appointment check = (Appointment)appointments.get(x);
for (int y = appointments.size()-1; y > x; y --)
Appointment nextApp =(Appointment) appointments.get(y);
if (check.match(nextApp))
{ System.out.println("Duplicate appointments: ");
check.print();
nextApp.print();
Prints the Calendar.
public void print()
{ System.out.println(name + " C A L E N D A R");
System.out.println();
System.out.println("Date Starttime EndTime Appointment");
for (int i = 0; i < appointments.size(); i++)
{ Appointment nextApp =(Appointment) appointments.get(i);
nextApp.print();
private Vector appointments;
private String name;
private Appointment theAppointment;
Describes an appointment.
class Appointment
public Appointment(Date aStarttime,Date aEndtime, String aApp)
starttime = aStarttime;
endtime = aEndtime;
app = aApp;
Method to test whether on object equals another.
@param otherObject The other object.
@return true if equal, false if not
public boolean equals(Object otherObject)
if (otherObject instanceof Appointment)
{ Appointment other = (Appointment)otherObject;
return (date.equals(other.date) && starttime.equals(other.starttime)
&& endtime.equals(other.endtime) && app.equals(other.app));
else return false;
Method to test whether part of an object equals another.
@param otherObject The other object.
@return true if equal, false if not
public boolean match(Object otherObject)
if (otherObject instanceof Appointment)
{ Appointment other = (Appointment)otherObject;
return (date.equals(other.date) && starttime.equals(other.starttime)
&& endtime.equals(other.endtime));
else return false;
Prints the Date, Starttime, Endtime and a description of the
appointment.
public void print()
{ System.out.println();
System.out.println(date + " " + starttime + " " + endtime
+ " " + app );
System.out.println();
private Date starttime;
private Date endtime;
private String app;The methods you used to instantiate your new dates has been deprecated and should no longer be used. This is just a warning though and your code will still work. Sun is just telling you that they no longer support those constructors for the Date class and that future releases of J2SE may not have them included in the API. If you wanted to, you could ignore it, or you could use the sample code instead for your Date creations:
//need the following additional import
import java.text.*;
//HH is hours (0-23) see SimpleDateFormat for others
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
Date start= formatter.parse("06/02/2003 15:00:00");
Date end = formatter.parse("06/02/2003 16:00:00");tajenkins -
Hi everyone,
My iphone and Ipad got stollen yesterday...
I registered my Ipad onto "my profile" but when I tried to register my Iphone 4 onto "My Profile" it says that the product has been registered under ANOTHER apple ID. What does this mean?! Does this mean that the thief is using my phone under a new apple ID?!
I am getitng abit paranoid because when I tried to download a new app onto my macbook pro, it says that someone had accessed my account from a new computer. I am so scared.. as I know that if they are able to access my apple ID account they can see my billing/card details. I tried to delete my billing address and card details on my apple ID account to prevent this from occuring but I can't. Please help
Many thanks,
KimYou should change your AppleID password NOW. And if it says it was registered under another AppleID, the thief has probably done it.
-
I received this error message when trying to use my time capsule. Macbook Air.sparsebundle already is use. What does this mean?
First, restart the MacBook Air and the Time Capsule. In most of the cases, this solves the problem.
If not, see > http://pondini.org/TM/C12.html -
When Installing Windows 7 using Bootcamp, I get message: "Need 64 bit Windows installation USB drive or DVD." What does this mean?
It means you need the 64 bit Version of Windows on a USB stick or DVD.
-
Given file name or path contains Unicode or double-byte characters. Retry using ASCII characters for filename and path
What does this mean? It is happening when I try to publish an OAM for Dreamweaver.
Also: How can I specify the browser in Edge Animate? It is just going wherever. Are there no Preferences for Edge Animate?
BTW. Just call it Edge. Seriously. Do you call it Illustrator Draw? Photoshop Retouching?No, my file name is mainContent.oam
My project name is mainContent.an
This error happens when I try to import into Dreamweaver. Sorry, I wasn't clear on that earlier.
I thought maybe it was because I had saved my image as a png. So re-saved as a svg, still get the error.
DO I have a setting is Dreamweaver CC that is wrong? Should I try this in Dreamweaver CS6? I might try that next.
Why is this program so difficult? I know Flash. I know After Effects. I can work the timeline part just great. It's always in the export that I have problems.
On a MacPro, 10.7.
Are you an Adobe person or just a nice helper? -
I have a Nikon D600 and D800 and I shoot everything in Raw. I use Photoshop Elements 9 for processing but I have been unable to convert any RAW files to open in PSE. Says unable to parse the file. What does this mean and how do I fix it?
Since pse 9 can only use up to camera raw 6.5 and the d600 needs at least 7.3 and the d800 needs at least 6.7, you can use the
8.6 adobe dng converter to convert those files to dng copies, which then pse 9 should open.
8.6 dng converter
windows
Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.6
mac
Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.6
Note:
If you have windows xp or vista or mac os x 10.6, then you'll need to use the 8.3 dng converter instead
windows
Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.3
mac
Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.3
how to use the dng converter
Camera Raw: How to use Adobe DNG Converter - YouTube
more info on supported cameras and camera raw plugins required
Camera Raw plug-in | Supported cameras
Camera Raw-compatible Adobe applications -
When I plug my iPod in my computer, "This iPod cannot be used because the Apple Mobile Device is not started" message pops up. What does this mean and how can I fix it?
Hello di_gitrdone,
Start with this article describing how to restart this service.
http://support.apple.com/kb/ts1567
B-rock
Maybe you are looking for
-
Xcelsius 2008 on top of SAP BPC
Hi Experts, I am trying to use Xcelsius 2008 on top of SAP BPC. I want following functionality in my dashboard: 1. There is a drop down in the dashboard for Year-Month selection. 2. Based on that selection, the BPC query to be refreshed for the selec
-
Hi, I have an applet that has a label which is made as a hyperlink. When its clicked i need launch a new browser for the clicked hyperlink. How can this be done? Thanks in advance Roopa
-
My MacPro would not startup; the chime never happened but the fans started and kept running. I shut down by holding the power key down, and then tried restarting. It started up the this, the second attempt. I then restarted using the install Snow Leo
-
Greetings, I m calling FIVE FM namely, BAPI_ALM_ORDER_MAINTAIN BAPI_TRANSACTION_COMMIT, BAPI_ALM_NOTIF_DATA_ADD, BAPI_ALM_NOTIF_SAVE, BAPI_TRANSACTION_COMMIT in the sequence written above.But i am not able to add data to a created notification (creat
-
JMenu and MouseListener problems
I have a JMenu that is used as a JMenuItem in another JMenu in the menu bar. The same JMenu is added as a popup menu to a button. I added a MouseListener to the JMenu because I want to execute some code upon mouseEntered() and mouseExited(). Problem: