正在看算法第四版,在intellij-diea下装algs4.jar库,参见这个知乎地址里面lhyz的回答,然后报错:
"C:Program FilesJavajdk1.8.0_74binjava" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:62130,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "C:Program FilesJavajdk1.8.0_74jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_74jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_74jrelibextaccess-bridge-64.jar;C:Program FilesJavajdk1.8.0_74jrelibextcldrdata.jar;C:Program FilesJavajdk1.8.0_74jrelibextdnsns.jar;C:Program FilesJavajdk1.8.0_74jrelibextjaccess.jar;C:Program FilesJavajdk1.8.0_74jrelibextjfxrt.jar;C:Program FilesJavajdk1.8.0_74jrelibextlocaledata.jar;C:Program FilesJavajdk1.8.0_74jrelibextnashorn.jar;C:Program FilesJavajdk1.8.0_74jrelibextsunec.jar;C:Program FilesJavajdk1.8.0_74jrelibextsunjce_provider.jar;C:Program FilesJavajdk1.8.0_74jrelibextsunmscapi.jar;C:Program FilesJavajdk1.8.0_74jrelibextsunpkcs11.jar;C:Program FilesJavajdk1.8.0_74jrelibextzipfs.jar;C:Program FilesJavajdk1.8.0_74jrelibjavaws.jar;C:Program FilesJavajdk1.8.0_74jrelibjce.jar;C:Program FilesJavajdk1.8.0_74jrelibjfr.jar;C:Program FilesJavajdk1.8.0_74jrelibjfxswt.jar;C:Program FilesJavajdk1.8.0_74jrelibjsse.jar;C:Program FilesJavajdk1.8.0_74jrelibmanagement-agent.jar;C:Program FilesJavajdk1.8.0_74jrelibplugin.jar;C:Program FilesJavajdk1.8.0_74jrelibresources.jar;C:Program FilesJavajdk1.8.0_74jrelibrt.jar;D:javalearnoutproductionjavalearn;D:algs4.jar;D:Program Files (x86)JetBrainsIntelliJ IDEA Community Edition 2016.2.4libidea_rt.jar" com.company.BinarySearch D:algs4.jar
Connected to the target VM, address: '127.0.0.1:62130', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:62130', transport: 'socket'
Exception in thread "main" java.lang.NumberFormatException: For input string: "PK N�bI "
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at edu.princeton.cs.algs4.In.readAllInts(In.java:443)
at com.company.BinarySearch.main(BinarySearch.java:70)
Process finished with exit code 1
com.company.BinarySearch.main(BinarySearch.java:70)这一行的内容是:
int[] whitelist = new In(args[0]).readAllInts();