2016-09-01 44 views
0

我不認爲這是重複的,因爲我一直無法找到一個解決方案,在這裏在stackoverflow和其他網站/論壇。我列出了我嘗試過的所有內容,並且沒有在下面工作。com/sencha/core/functional /操作:不支持的major.minor版本與java的版本爲51 1.8.0

我想在OSX El Capitain的終端上運行命令「sencha app build native」,並且遇到以下錯誤。

Sencha Cmd v6.1.3.42 
[INF] Using GPL version of Sencha Touch version 2.3.0 from /Users/myuser/Downloads/MyProject_2/touch. 
[INF] The implications of using GPL version can be found here (http://www.sencha.com/products/extjs/licensing). 
[INF] Processing Build Descriptor : native 
[INF] Loading app json manifest... 
[INF] Writing output to file /Users/myuser/Downloads/MyProject_2/build/temp/production/MyProject/sencha-compiler/cmd-packages.js 
[INF] writing content to /Users/myuser/Downloads/MyProject_2/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/bootstrap.js 
[INF] Appending content to /Users/myuser/Downloads/MyProject_2/bootstrap.json 
[WRN] C1014: callParent has no target (me.callParent in Ext.dataview.DataView.onAfterRender) -- /Users/myuser/Downloads/MyProject_2/touch/src/dataview/DataView.js:892 
[WRN] C1014: callParent has no target (this.callParent in Ext.Decorator.setDisabled) -- /Users/myuser/Downloads/MyProject_2/touch/src/Decorator.js:157 
[WRN] C1014: callParent has no target (this.callParent in Ext.data.ArrayStore.loadData) -- /Users/myuser/Downloads/MyProject_2/touch/src/data/ArrayStore.js:64 
[WRN] C1014: callParent has no target (this.callParent in Ext.fx.animation.Wipe.getData) -- /Users/myuser/Downloads/MyProject_2/touch/src/fx/animation/Wipe.js:119:7 
[INF] Writing concatenated output to file /Users/myuser/Downloads/MyProject_2/cordova/www/app.js 
[INF] merging 0 input resources into /Users/myuser/Downloads/MyProject_2/cordova/www/resources 
[INF] merged 0 resources into /Users/myuser/Downloads/MyProject_2/cordova/www/resources 
[INF] merging 46 input resources into /Users/myuser/Downloads/MyProject_2/cordova/www 
[INF] merged 0 resources into /Users/myuser/Downloads/MyProject_2/cordova/www 
[INF] writing content to /Users/myuser/Downloads/MyProject_2/sass/example/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/sass/example/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/sass/example/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/sass/example/bootstrap.js 
[INF] appending content to /Users/myuser/Downloads/MyProject_2/sass/example/bootstrap.js 
[ERR] 
[ERR] BUILD FAILED 
[ERR] java.lang.UnsupportedClassVersionError: com/sencha/core/functional/Action : Unsupported major.minor version 51.0 
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCom 
[ERR] mand.dispatch(BasePluginCommands.java:260) 
[ERR] 
[ERR] Total time: 7 seconds 
[ERR] The following error occurred while executing this line: 
/Users/myuser/Downloads/MyProject_2/.sencha/app/build-impl.xml:285: The following error occurred while executing this line: 
/Users/myuser/Downloads/MyProject_2/.sencha/app/sass-impl.xml:310: The following error occurred while executing this line: 
/Users/myuser/Downloads/MyProject_2/.sencha/app/sass-impl.xml:316: com.sencha.exceptions.BasicException: com/sencha/core/functional/Action : Unsupported major.minor version 51.0 

該錯誤告訴我,我的Java安裝程序有問題,但我不知道什麼。在終端中檢查我的版本顯示以下內容。

$ Java的版本 Java版本 「1.8.0_101」 的Java(TM)SE運行時環境(建1.8.0_101-B13) 的HotSpot的Java(TM)64位服務器VM(25.101建設-B13,混合模式)

通過系統預置開放的Java顯示只安裝了一個Java版本是1.8與'/庫/互聯網插件/ JavaAppletPlugin.plugin /內容/首頁/斌/ Java的

安裝路徑在終端中運行'/ Library/Internet \ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version'也顯示版本1.8

運行'/ usr/bin/java -version'也給出版本1.8

我已經嘗試添加這3行的變體以嘗試解決問題,但它似乎沒有改變任何東西。正如你可以看到我也試圖改變存儲以防萬一這可能是內存問題

ANT_OPTS="-Xms1024m -Xmx2048m" 
export PATH="/usr/local/bin:$PATH" 
export JAVA_HOME="/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" 

我也嘗試運行「煎茶的應用程序建立-c」這給了同樣的錯誤。

我也嘗試添加下列到sencha.cfg,看它是否可能幫助

cmd.jvm.args=-Xms512m -Xmx2048m 

我也試着從蘋果https://support.apple.com/kb/dl1572它說,它安裝的Java 6的運行舊版本的安裝此更新

我也嘗試安裝Java SDK的7和Java SDK的8看看有沒有什麼幫助,沒有運氣

我還可以嘗試以修復錯誤「不支持MAJOR.MINOR版本51.0」做[R elating到煎茶建立

+0

也許在您的pom中聲明瞭錯誤的目標版本? – Jens

+0

@Jens對不起,我主要是一名php開發人員,我沒有在我的項目文件夾中看到一個pom.xml文件。我在哪裏可以找到這個設置? – Matkey

回答

1

我終於改變我的JAVA_HOME變量「/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home」解決了這個

我把的.bashrc以下和.bash_profile確保刪除與java或JAVA_HOME變量相關的任何其他內容。您可以使用如下命令「納米/Users/$USER/.bash_profile」編輯文件

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home" 
export PATH=$JAVA_HOME/bin:$PATH 

類型「回聲$ JAVA_HOME」在終端,以確保您設置了正確的道路。

然後重新啓動Mac和嘗試運行一次「煎茶應用打造本土」命令,它應該工作或拋出一個不同的錯誤(至少其進度)

請注意,你需要做之前安裝JDK 1.7這裏,在這裏下載http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

您的版本可能與我的不同,所以打開終端並鍵入'cd/Library/Java/JavaVirtualMachines /'切換目錄,然後鍵入'ls -la'列出所有您擁有的文件那裏。您應該看到一個名爲jdk1.7.0_XX.jdk的文件

相關問題