Java報錯:Exception in thread "main" java.lang.UnsupportedClassVersionError
報錯如下:
錯誤原因
檢查之後發現,原來是所在包的應用的jdk與電腦上安裝Eclipse中預設設定的jdk不同,導致該錯誤。
解決方案
點選選單欄下的Preferences,進入Preferences後,點選Java-Compiler,在jdk Compliance處選擇對應的版本,由於我採用的是1.8(如下圖)
所以,我選擇在下面選擇1.8。然後點選應用並關閉(Apply and Close)。
相關文章
- Appcrawler 執行報錯 Exception in thread "main" java.lang.NullPointerExceptionAPPExceptionthreadAIJavaNull
- jmeter報錯“Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]“JMeterExceptionthreadAI
- myeclipse執行tomcat報錯Exception in thread "main" java.lang.OutOfMemoryError: PermGen space...EclipseTomcatExceptionthreadAIJavaError
- Exception in thread "main" java.lang.NullPointerException: Cannot invokeExceptionthreadAIJavaNull
- Exception in thread “main” 終極解決方案ExceptionthreadAI
- Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/http/conn/socket/LayeredConnecExceptionthreadAIJavaErrorApacheHTTP
- 解決:Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.ExceptionthreadAIJavaElasticsearch
- Exception in thread “main“ java.lang.ArrayStoreException解決方案(記錄一下)ExceptionthreadAIJava
- Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission deniedUseExceptionthreadAIApacheHadoop
- AS執行main()方法報錯:SourceSet with name ‘main‘ not foundAI
- 使用URLClassLoader報錯not class found exceptionException
- 找不到so的問題,in thread “main“ java.lang.UnsatisfiedLinkError: no xxlibrary in java.library.paththreadAIJavaError
- 報錯:nested exception is java.lang.NoClassDefFoundError: org/fusesource/hawtbuf/UTF8BufferExceptionJavaError
- pytest.main () 為什麼會報錯?AI
- Exception in thread “main” com.sun.xml.internal.ws.model.RuntimeModelerException: 必須在沒有程式包的類上指定 @WebService.targetNamespace。ExceptionthreadAIXMLWebnamespace
- dubbo和spring結合報錯 Invocation of init method failed; nested exception is java.lang.IllegalArgumentExceSpringAIExceptionJava
- idea執行java專案main方法報build failure錯誤的解決方法IdeaJavaAIUI
- 【已解決】IDEA 2020.3 java.lang.UnsupportedClassVersionErrorIdeaJavaError
- 執行composer install報錯:Symfony\Component\Process\Exception\ProcessTimedOutExceptionException
- RocketMQ報錯:rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeoutMQREMExceptionOOM
- 【Weblogic】java.lang.UnsupportedClassVersionError問題處理方案WebJavaError
- java exception and finally returnJavaException
- Java - 25 main方法JavaAI
- 11.2.0.1bug引發的報錯:ORA-07445: exception encounteredException
- 原創:java.lang.UnsupportedClassVersionError: Bad version number in .class fileJavaError
- Java-Exception與RuntimeExceptionJavaException
- 使用SockJS 報錯 Incompatibile SockJS! Main site uses: “1.0.3“, the iframe: “1.0.0“. 已處理JSAI
- Java-關於ThreadJavathread
- java報錯大合集Java
- 在docker中啟動服務報錯:New main PID 558 does not belong to serviceDockerAI
- Java進階之詳談ExceptionJavaException
- https Java SSL Exception protocol_versionHTTPJavaExceptionProtocol
- Three ways to create Multi Thread in JavathreadJava
- java Thread的狀態分析Javathread
- Elasticsearch 6 建立索引報錯 invalid_index_name_exception Invalid index name [testDemo], must be lowercaseElasticsearch索引IndexException
- async 與 Thread 的錯誤結合thread
- Java 中的Exception 有什麼用?JavaException
- Eclipse 給 Java 應用建立 Run configuration 時找不到 main type 的錯誤訊息EclipseJavaAI