Java報錯:Exception in thread "main" java.lang.UnsupportedClassVersionError
報錯如下:
錯誤原因
檢查之後發現,原來是所在包的應用的jdk與電腦上安裝Eclipse中預設設定的jdk不同,導致該錯誤。
解決方案
點選選單欄下的Preferences,進入Preferences後,點選Java-Compiler,在jdk Compliance處選擇對應的版本,由於我採用的是1.8(如下圖)
所以,我選擇在下面選擇1.8。然後點選應用並關閉(Apply and Close)。
相關文章
- Exception in thread "main" java.lang.UnsupportedClassVersionError:ExceptionthreadAIJavaError
- Appcrawler 執行報錯 Exception in thread "main" java.lang.NullPointerExceptionAPPExceptionthreadAIJavaNull
- oracle dbca報Exception in thread mainOracleExceptionthreadAI
- jmeter報錯“Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]“JMeterExceptionthreadAI
- Exception in thread "main" java.lang.NoClassDefFoundErrorExceptionthreadAIJavaError
- Exception in thread "main" java.lang.NoClassDefFoundError錯誤資訊(轉帖)ExceptionthreadAIJavaError
- Exception in thread "main" java.lang.NullPointerException: Cannot invokeExceptionthreadAIJavaNull
- myeclipse執行tomcat報錯Exception in thread "main" java.lang.OutOfMemoryError: PermGen space...EclipseTomcatExceptionthreadAIJavaError
- Exception in thread "main" java.lang.ClassCastException: $Proxy13ExceptionthreadAIJavaAST
- Oracle 11g 安裝RAC時報錯'Exception in thread "main" java.lang'OracleExceptionthreadAIJava
- Exception in thread “main” 終極解決方案ExceptionthreadAI
- oracle dbca報Exception in thread main 問題解決一例OracleExceptionthreadAI
- Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/http/conn/socket/LayeredConnecExceptionthreadAIJavaErrorApacheHTTP
- Exception in thread “main“ java.lang.ArrayStoreException解決方案(記錄一下)ExceptionthreadAIJava
- Exception in thread "main" java.lang.UnsatisfiedLinkError: i386/libawt.soExceptionthreadAIJavaError
- 解決:Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.ExceptionthreadAIJavaElasticsearch
- 【原】MyEclipse8.5整合Tomcat7時啟動錯誤:Exception in thread “main” java.lang.NoClassDefFoundErrorEclipseTomcatExceptionthreadAIJavaError
- 請問錯誤提示Exception in thread "main" java.lang.NoClassDefFoundError是否是環境變數的配置問題ExceptionthreadAIJavaError變數
- Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission deniedUseExceptionthreadAIApacheHadoop
- Exception in thread "main" ,設定Oracle9i,10g環境變數ExceptionthreadAIOracle變數
- AS執行main()方法報錯:SourceSet with name ‘main‘ not foundAI
- myeclipse中傳送郵件出現Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStreamEclipseExceptionthreadAIJavaError
- java 異常:java.lang.UnsupportedClassVersionErrorJavaError
- 使用URLClassLoader報錯not class found exceptionException
- 為何在JBoss中釋出Message-Driven Bean總出Exception in thread "main" javax.naming.NamBeanExceptionthreadAIJava
- 報錯:nested exception is java.lang.NoClassDefFoundError: org/fusesource/hawtbuf/UTF8BufferExceptionJavaError
- Oracle10g 報錯'java.lang.Exception: No such metric'的解決方法OracleJavaException
- pytest.main () 為什麼會報錯?AI
- Java——ExceptionJavaException
- Oracle10g 報錯'java.lang.Exception: No such metric'的解決方法[轉載]OracleJavaException
- idea執行java專案main方法報build failure錯誤的解決方法IdeaJavaAIUI
- dubbo和spring結合報錯 Invocation of init method failed; nested exception is java.lang.IllegalArgumentExceSpringAIExceptionJava
- 找不到so的問題,in thread “main“ java.lang.UnsatisfiedLinkError: no xxlibrary in java.library.paththreadAIJavaError
- Exception in thread “main” com.sun.xml.internal.ws.model.RuntimeModelerException: 必須在沒有程式包的類上指定 @WebService.targetNamespace。ExceptionthreadAIXMLWebnamespace
- 【Weblogic】java.lang.UnsupportedClassVersionError問題處理方案WebJavaError
- Java——main函式JavaAI函式
- Java - 25 main方法JavaAI
- 原創:java.lang.UnsupportedClassVersionError: Bad version number in .class fileJavaError