-
Bug
-
Resolution: Unresolved
-
P4
-
8, 9, 10, 11
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 10. Tested with other Java version like 1.6 and also there it is reproducible.
A DESCRIPTION OF THE PROBLEM :
On Windows 10: When the method is invoked with a file like "exmaple.car" and there is no application registered for the file extension ".car", the OS displays the "Choose app to open file" dialog and the method returns silently without any exception.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See example source code below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
According to the javadoc "@throws IOException if the specified file has no associatedapplication or the associated application fails to be launched"
ACTUAL -
No exception is thrown.
---------- BEGIN SOURCE ----------
import java.io.File;
public class Example {
public static void main(String[] args) {
try {
File file = new File("example.extension");
file.createNewFile();
java.awt.Desktop.getDesktop().open(file);
} catch (Exception ex) {
ex.printStackTrace();
return;
}
System.out.println("No exception");
}
}
---------- END SOURCE ----------
FREQUENCY : always
Windows 10. Tested with other Java version like 1.6 and also there it is reproducible.
A DESCRIPTION OF THE PROBLEM :
On Windows 10: When the method is invoked with a file like "exmaple.car" and there is no application registered for the file extension ".car", the OS displays the "Choose app to open file" dialog and the method returns silently without any exception.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See example source code below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
According to the javadoc "@throws IOException if the specified file has no associatedapplication or the associated application fails to be launched"
ACTUAL -
No exception is thrown.
---------- BEGIN SOURCE ----------
import java.io.File;
public class Example {
public static void main(String[] args) {
try {
File file = new File("example.extension");
file.createNewFile();
java.awt.Desktop.getDesktop().open(file);
} catch (Exception ex) {
ex.printStackTrace();
return;
}
System.out.println("No exception");
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8064934 Incorrect Exception message from java.awt.Desktop.open()
-
- Resolved
-
- links to