netbeans java移动应用程序和scala应用程序

时间:2010-12-08 19:17:28

标签: java scala netbeans java-me

我有两个netbeans项目,一个是j2me应用程序,另一个是scala应用程序 我将scala应用程序的编译jar包含为j2me应用程序的资源。

结果如下:

Created dir: C:\Users\Para\Documents\NetBeansProjects\Barbut\build\compiled
Expanding: C:\Users\Para\Documents\NetBeansProjects\ScalaLogic\dist\ScalaLogic.jar into C:\Users\Para\Documents\NetBeansProjects\Barbut\build\compiled
do-compile:
Compiling 1 source file to C:\Users\Para\Documents\NetBeansProjects\Barbut\build\compiled
C:\Users\Para\Documents\NetBeansProjects\Barbut\build\compiled\MainLogic\Test.class: warning: Cannot find annotation method 'bytes()' in type 'scala.reflect.ScalaSignature': class file for scala.reflect.ScalaSignature not found
1 warning
post-compile:
compile:
pre-obfuscate:
proguard-init:
skip-obfuscation:
proguard:
post-obfuscate:
obfuscate:
lwuit-build:
pre-preverify:
do-preverify:
Created dir: C:\Users\Para\Documents\NetBeansProjects\Barbut\build\preverifysrc
Copying 2 files to C:\Users\Para\Documents\NetBeansProjects\Barbut\build\preverifysrc
Created dir: C:\Users\Para\Documents\NetBeansProjects\Barbut\build\preverified
Preverifying 2 file(s) into C:\Users\Para\Documents\NetBeansProjects\Barbut\build\preverified directory.
Error preverifying class MainLogic.Test
    java/lang/NoClassDefFoundError: scala/ScalaObject
C:\Users\Para\Documents\NetBeansProjects\Barbut\nbproject\build-impl.xml:472: Preverification failed with error code 1.
BUILD FAILED (total time: 9 seconds)

有谁知道出了什么问题?谢谢

2 个答案:

答案 0 :(得分:0)

你可能错过了scala-library jar,因为你的scala应用程序jar依赖于它。您收到NoClassDefFoundError的类scala / ScalaObject驻留在该库中。

您可以从此处http://www.scala-lang.org/downloads下载。请务必使用与您的scala应用程序相同的版本。

答案 1 :(得分:0)

@thoredge 我尝试了,现在我收到了一个新的错误

Compiling 1 source file to C:\Users\Para\Documents\NetBeansProjects\Barbut\build\compiled
C:\Users\Para\Documents\NetBeansProjects\Barbut\build\compiled\scala\reflect\ScalaSignature.class: warning: Cannot find annotation method 'value()' in type 'java.lang.annotation.Retention': class file for java.lang.annotation.Retention not found
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.annotation.RetentionPolicy not found
C:\Users\Para\Documents\NetBeansProjects\Barbut\nbproject\build-impl.xml:379: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 minute 2 seconds)

似乎这是scala需要的java 5语言功能,java me虚拟机使用1.4或类似的东西

有没有办法通过这个?

相关问题