This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225937

Summary: Incorrect classpath for obfuscator in J2ME project
Product: javame Reporter: rjksmith
Component: Build SystemAssignee: Roman Svitanic <rsvitanic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.2.1   
Hardware: Macintosh (x86)   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description rjksmith 2013-02-09 15:28:03 UTC
My J2ME NB project has ProGuard obfuscation enabled for its release build. In the generated build-impl.xml, the obfuscator class path includes the extra.classpath, which I believe is a list of project libraries /excluded/ from the current build configuration.

        <nb-obfuscate srcjar="${obfuscator.srcjar}" destjar="${obfuscator.destjar}" obfuscatorclasspath="${obfuscator.classpath}" classpath="${platform.bootclasspath}:${extra.classpath}" obfuscationLevel="${obfuscation.level}" extraScript="${obfuscation.custom}"/>

I believe this is incorrect and extra.classpath should be omitted from this line.

I have been integrating Hammock (mock objects for J2ME) to my project, and found my build failed because Proguard cannot parse the HammockMaker jar file.

Reading library jar [.../hammock-2.1.0/dist/hammock_midp20_cldc11-2.1.0.jar]
Error: Can't read [proguard.ClassPathEntry@4c7e9bed] (Can't process class [com/hammingweight/hammockmaker/AMethodWrapper.class] 
(Unsupported version number [51.0] for class format))
Reading library jar [.../hammock-2.1.0/hammockmaker/dist/hammockmaker-2.1.0.jar]
.../nbproject/build-impl.xml:397: Obfuscation failed with error code 1.
BUILD FAILED (total time: 3 seconds)

I suspect this is because it's a Java 1.5 code, and there are known incompatibility issues between J1.4+ and earlier versions. However, the build error is spurious as HammockMaker is a build tool only, and not included in the deployed code, i.e. it is a project library, but not included in this build configuration.

I've manually edited my build-impl.xml as a workaround, but thought I should report the issue to you. I hope this is helpful. Please let me know if you need further details.
Comment 1 David Strupl 2013-04-09 11:22:42 UTC
Assigning to the new owner of javame modules.