J2SE - Could not find the main class: xxx.xxx.Program will exit
問題
在Windows下,直接執行jar檔案時,無法執行並報錯
Could not find the main class: xxx.xxx.Program will exit
但在命令列下通過 java -jar jar_name.jar 命令可以執行
方案
系統開始裝的是Jdk1.8,後開發需要裝過Jdk1.6,但環境變數還是1.8的
修改登錄檔
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command
編輯或修改名稱為預設的鍵值對的值為對應版本的javaw.exe
"C:\Develop\Jdk-1.8.0\jre\bin\javaw.exe" -jar "%1" %*
相關文章
- Could not find the main class. Program will exitAI
- jar檔案could not find the main class解決JARAI
- java編譯 Error: Could not find or load main class java執行包main方法Java編譯ErrorAI
- crontab執行jar包時,Could not find or load main class(找不到或者載入不到主類)JARAI
- swing程式打成jar包,執行出現(could not find the main class)問題,請高手指點!!JARAI
- 請教:castor MappingException: Could not find the class異常ASTAPPException
- java.lang.IllegalArgumentException: Could not find class異常解決方式JavaException
- Find User-exit and BADIs
- Fatal error: Uncaught PDOException: could not find driverErrorException
- Could not find *.apk!解決辦法APK
- springboot專案打包提示Unable to find a single main class from the following candidates錯誤Spring BootAI
- nested exception is IncompleteElementException: Could not find parameter mapException
- Could not find a suitable set of interfaces for VIPs.UI
- vue3 Could not find a declaration file for moduleVue
- 解決cannot find module providing package或cannot find main modulePackageAI
- Android:Unable to find explicit activity classAndroid
- Could not find jar tool executable問題解決JAR
- OGG-00446 ERROR: Could not find archived logErrorHive
- 錯誤 - Could not find the index entry for RIDIndex
- VueX Vue: Could not find a declaration file for module vuex.Vue
- J2SE - Java命令執行class和jar檔案JavaJAR
- ogg GGS ERROR 500 Could not find archived logErrorHive
- SQL error 2812: Could not find stored procedure.docSQLError
- cmake報錯CMake Error: Could not find CMAKE_ROOTError
- Could not initialize class org.apache.xpath.compiler.FunctionTableApacheCompileFunction
- kattle Driver class 'oracle.jdbc.driver.OracleDriver' could not be foundOracleJDBC
- 關於 artisan migrants Could not find drive 解決方法
- Helper Devise: could not find the `Warden::Proxy` instance on request environmentdev
- master bug InnoDB Error unlock row could not find a 4 mode lockASTError
- Could not find first log file name in binary log index fileIndex
- Could not initialize class sun.awt.X11GraphicsEnvironment 報錯
- FATAL ERROR: Could not find ./bin/my_print_defaults 解決方法Error
- Could not initialize class sun.awt.X11GraphicsEnvironment解決方案
- 解決CocoaPods could not find compatible versions for pod "React/Core"React
- PostgreSQL pg_rewind例項--could not find previous WAL record at %X/%XSQL
- This application failed to start because it could not find or load the Qt platform plugin “windows“APPAIQTPlatformPluginWindows
- Application failed to start because it could not find or load the QT platform plugin “windows”APPAIQTPlatformPluginWindows
- Error:Could not find com.android.tools.build:gradle:2.2.2.ErrorAndroidUIGradle