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" %*
相關文章
- crontab執行jar包時,Could not find or load main class(找不到或者載入不到主類)JARAI
- Cannot resolve com.demo.common:1.0-SNAPSHOTble to find main classAI
- java.lang.IllegalArgumentException: Could not find class異常解決方式JavaException
- Fatal error: Uncaught PDOException: could not find driverErrorException
- 解決cannot find module providing package或cannot find main modulePackageAI
- vue3 Could not find a declaration file for moduleVue
- VueX Vue: Could not find a declaration file for module vuex.Vue
- J2SE - Java命令執行class和jar檔案JavaJAR
- cmake報錯CMake Error: Could not find CMAKE_ROOTError
- 關於 artisan migrants Could not find drive 解決方法
- 解決CocoaPods could not find compatible versions for pod "React/Core"React
- This application failed to start because it could not find or load the Qt platform plugin “windows“APPAIQTPlatformPluginWindows
- Could not find or access '/etc/ansible/bin/cfssljson /etc/ansible/bin/cfsslJSON
- Could not initialize class sun.awt.X11GraphicsEnvironment 報錯
- iOS-拉outlet到程式碼區錯誤:Could not insert new outlet connection: Could not find any...iOS
- ERROR | [iOS] unknown: Encountered an unknown error (Could not find a `ios` simulator (valid values:ErroriOS
- Could not initialize class sun.awt.X11GraphicsEnvironment解決方案
- PostgreSQL pg_rewind例項--could not find previous WAL record at %X/%XSQL
- Could not find a version that satisfies the requirement py4j (from versions: ) No matching distributUIREM
- Could not initialize class sun.awt.X11GraphicsEnvironment異常處理
- 64位linux報錯Could not initialize class java.awt.image.BufferedImageLinuxJava
- 引入第三方庫報錯Could not find method apt() for argumentsAPT
- nancy Unable to find view engine that could render the view 無法找到檢視模板引擎NaNView
- 記一次 報錯:Android ClassNotFoundException: Didn't find class on pathAndroidException
- 【BUG系列】multiDexEnabled true 不能亂寫啊,ClassNotFoundException: Didn't find class "***IDEException
- Flask擴充套件包安裝出現錯誤:Could not find a version that satisfies the requirement ...Flask套件UIREM
- VS中呼叫QT出現This application failed to start because it could not find or load the Qt platform pluginQTAPPAIPlatformPlugin
- 錯誤 qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in ““ 的解決方法QTPluginPlatformWindows
- exit hookHook
- glibc中_start、__libc_start_main、main、exit、init、finit、rtld_fini這幾個函式的包含關係和呼叫先後順序是什麼AI函式
- 「Jupyter」UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.UI
- exit(0)與exit(1)、return的區別
- nexus私服SNAPSHOT倉庫maven-metadata.xml缺失導致的Could not find artifact:***.jarMavenXMLJAR
- python中 os._exit() 和 sys.exit(), exit(0)的用法和區別Python
- Dynamics CRM 安裝SSRS Extension時報Could not find the name or insufficient right to see name的解決方法
- system.exit(0)和system.exit(1)的區別
- 2.13.5 DBCA Exit Codes
- 解決Qt編譯動態連結庫could not find or load the Qt platform plugin "windows" in.問題QT編譯PlatformPluginWindows