0

I have 2 projects in netbeans, one a j2me application and one a scala application I included the compiled jar of the scala application as a resource for the j2me application.

This is the result:

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)

Does anyone have any idea what is going wrong? thank you

Para
  • 2,022
  • 5
  • 34
  • 73

1 Answers1

0

You're probably missing the scala-library jar since your scala application jar depends on it. The class scala/ScalaObject, which you receive an NoClassDefFoundError for, resides in that library.

You can download it from here http://www.scala-lang.org/downloads. Be sure to get the same version as your scala application was built with.

thoredge
  • 12,237
  • 1
  • 40
  • 55
  • I think it'll be difficult to get passed that error you got now. This is as you say a jdk5 method and javame is just a subset of java. If you're really desperate you may want to look into RetroTranslator or RetroWeaver (see http://stackoverflow.com/questions/1011706/backport-java-5-6-features-to-java-1-4/1098923#1098923), but I wouldn't get my hopes for up too high. – thoredge Dec 13 '10 at 14:54