private static Player player = null;  if (player == null) {
musicfile = new File("C://ding.wav");
if(musicfile.exists() && musicfile.isFile()){
System.out.println("exist");
try {
     URL musicUrl = musicfile.toURI().toURL();
System.out.println(musicUrl);
//MediaLocator  locator=new MediaLocator("file:"+musicfile.getAbsolutePath());
player = Manager.createRealizedPlayer(musicUrl);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (NoPlayerException e) {
e.printStackTrace();
} catch (CannotRealizeException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}else{
System.out.println("音频文件不存在");
}如上代码在初始化player时候报NoPlayerException 我确定路径没有错的
打印也是“exist”是什么回事呢?