2010-12-08 157 views
0

我在netbeans中有2个项目,其中一个是j2me应用程序,另一个是scala应用程序 我包含scala应用程序的编译jar作为j2me应用程序的资源。netbeans Java移动应用程序和Scala应用程序

这是结果:

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) 

没有人有任何想法是怎么回事?谢谢

+0

你是如何在资源中添加它的?根据编译器,它不在classpath中。 – 2010-12-08 19:19:44

回答

0

@thoredge 我tryed这一点,现在我得到一个新的错误

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) 

看起来这是一个Java 5语言功能,斯卡拉要求和Java ME的虚拟机使用1.4或类似的东西

有什么办法可以通过这个吗?

0

你可能会错过scala-library jar,因为你的scala应用程序jar依赖它。您收到NoClassDefFoundError的类scala/ScalaObject驻留在该库中。您可以从这里下载http://www.scala-lang.org/downloads。一定要获得和你的scala应用程序一样的版本。

+0

嗨,我试过,现在我得到一个新的错误 – Para 2010-12-11 12:56:56