2010-12-08 63 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