首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

eclipse 提示异常,请.多谢

2012-03-02 
eclipse 提示错误,请高手指点.谢谢代码:try{FileInputStream fileaunew FileInputStream(alert.wav)Au

eclipse 提示错误,请高手指点.谢谢
代码:
try 
  {
  FileInputStream fileau=new FileInputStream("alert.wav");
  AudioStream as=new AudioStream(fileau);
  AudioPlayer.player.start(as);
  }
  catch(Exception e) { }
在调试中发出现这样的错误:
   
Multiple markers at this line
- Access restriction: The field player from the type AudioPlayer is not accessible due to restriction on required library F:
\jdk1.5\jre\lib\rt.jar
- Access restriction: The type AudioPlayer is not accessible due to restriction on required library F:\jdk1.5\jre\lib\rt.jar
- Access restriction: The method start(InputStream) from the type AudioPlayer is not accessible due to restriction on required 
library F:\jdk1.5\jre\lib\rt.jar

 

[解决办法]
你使用了sun.audio.AudioPlayer 这个非公开类,需要在eclipse选项里去掉限制。

热点排行