我正在使用Eclipse和Codename One。 當我建立我的申請,我收到以下錯誤:codename one build error:suggest「use -source 7」
-----
Buildfile: C:\P\eclipse_workspace\HelloWorld\build.xml
jar:
[echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
[echo] code size and wider device support
[copy] Copying 3 files to C:\P\eclipse_workspace\HelloWorld\build\tmp
[javac] C:\P\eclipse_workspace\HelloWorld\build.xml:147: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 39 source files to C:\P\eclipse_workspace\HelloWorld\build\tmp
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] C:\P\eclipse_workspace\HelloWorld\src\com\mycompany\lectures\Starter.java:197: error: strings in switch are not supported in -source 1.5
[javac] switch(option){
[javac] ^
[javac] (use -source 7 or higher to enable strings in switch)
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error
[javac] 3 warnings
BUILD FAILED
C:\P\eclipse_workspace\HelloWorld\build.xml:147: Compile failed; see the compiler error output for details.
Total time: 1 second
-----
如何解決在Eclipse這個問題呢?
謝謝!
我編輯了正確的代號一個基於解決方案的答案。原始解決方案對於一般Java項目是正確的,但與Codename One存在細微差異。 –
謝謝!這清除了一切...... – arastirmaci