编译时,显示以下消息:
com/javacodegeeks/jstringsearch/Main2.java:[133,57] underscores in literals are not supported in -source 1.6
(use -source 7 or higher to enable underscores in literals)
com/javacodegeeks/jstringsearch/file/LuceneWriteIndexFromFileExample.java:[120,13] try-with-resources is not supported in -source 1.6
(use -source 7 or higher to enable try-with-resources)
com/javacodegeeks/jstringsearch/memoryIndex/InMemoryLuceneIndex.java:[110,30] multi-catch statement is not supported in -source 1.6
(use -source 7 or higher to enable multi-catch statement)
我有版本 8。
告诉我该怎么做,还是我混淆了什么?如何解决这样的问题?
指定
pom.xml
编译器应将您的源解释为 java7: