You should add “throws IOException” to your main method:
public static void main(String[] args) throws IOException {
You can read a bit more about checked exceptions (which are specific to Java) in JLS.
More Related Contents:
- my program run 100% from compiler put not run 100% from dist
- How to catch an exception thrown by a function?
- How can I “intercept” Ctrl+C in a CLI application?
- Error message “unreported exception java.io.IOException; must be caught or declared to be thrown” [duplicate]
- java.io.IOException: mark/reset not supported
- Eclipse reading stdin (System.in) from a file
- What throws an IOException in Java?
- How to use readline() method in Java?
- java.io.IOException : No authentication challenges found
- Running external program with redirected stdin and stdout from Java
- java.util.scanner throws NoSuchElementException when application is started with gradle run
- Does close ever throw an IOException?
- Why can’t we read one character at a time from System.in?
- java IO Exception: Stream Closed
- Redirect stdin and stdout in Java
- javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary
- Java: Exception itself is null
- How to use Scanner to read silently from STDIN in Java?
- Write end dead exception using PipedInputStream java
- When is “java.io.IOException:Connection reset by peer” thrown?
- What’s the fastest way to read from System.in in Java?
- how to perform character concatenation in java [duplicate]
- How to write a Unit Test?
- Obtaining a powerset of a set in Java
- Parenthesis/Brackets Matching using Stack algorithm
- How to add close button to a JTabbedPane Tab?
- Why does LinkedHashSet extend HashSet and implement Set
- Pascal’s triangle 2d array – formatting printed output
- How to access USB ports in java [closed]
- Core dump taken with gcore, jmap conversion to hprof file format fails with Error message