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.
There is a request to allow execution through main() method on certain emulator. It is actually supported - Project properties | Running | Main class - however it is not very intuitive for beginner users. Users have to create a new project, delete the generate Xlet class, create a class with main() methos, go to the project properties and change the main class and execution method. It could be easily fixed by providing a new project template which would generate a project with the right class. The class should describe how to change the execution method in the comment. Here are the project types with new descriptions: CDC Application Creates a new CDC application in a standard IDE project. You can also generate a main class in the project. This project can also support a graphics application based on Personal Basis Profile (PBP) specification. Standard projects use an IDE-generated Ant build script to build, run, and debug your project. PBP Xlet Application Creates a new CDC/PBP (Personal Basis Profile) based application in a standard IDE project. You can also generate an Xlet based class in the project. Standard projects use an IDE-generated Ant build script to build, run, and debug your project.
This does not work the way as described above. The base type, CDC project only defines CDC project with main class or CD Library, it is responsibility of every supported platform to provide (override) default main template for the project. It can be only in range 0 - 1, if 0 is provided, the default one is used, if one is provided this is used. CDC project does not have ability to choose if the main will be main or xlet. If this does not hurt backward compatibility, I can change the default template into main (...) based entry point class. User can always create new main, xlet etc from provided project types and change the preferred one for execution in project properties.
fixed in http://hg.netbeans.org/main/rev/64a9e113dac9
Integrated into 'main-golden', will be available in build *201010160000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/64a9e113dac9 User: psuchomel@netbeans.org Log: Fix for #190905, Provide a new project template for main() execution (support for Oracle Java Embedded Client)
Also http://hg.netbeans.org/main/rev/f06acc6bbba9 for broken test
Backported into release692 http://hg.netbeans.org/releases/rev/1db68a4d3ba6 http://hg.netbeans.org/releases/rev/aaef1ba1ac45
On Ubuntu I have tried the Oracle Java(TM) Micro Edition Embedded Client Emulator with NetBeans 6.9 + Patch2. The platform is recognized properly by IDE. But when I create CDC Application project it is not possible to build it. Here is the output window content: ---------------------------------------%<--------------------------------------- The pre-init: pre-load-properties: exists.config.active: exists.netbeans.user: exists.user.properties.file: load-properties: exists.platform.active: exists.platform.configuration: exists.platform.profile: basic-init: cldc-pre-init: cldc-init: cdc-init: ricoh-pre-init: ricoh-init: semc-pre-init: semc-init: savaje-pre-init: savaje-init: sjmc-pre-init: sjmc-init: ojec-pre-init: ojec-init: cdc-hi-pre-init: cdc-hi-init: nokiaS80-pre-init: nokiaS80-init: nsicom-pre-init: nsicom-init: post-init: init: conditional-clean-init: conditional-clean: pre-clean: clean-timestamp: clean-preprocessed: clean-classes: clean-obfuscated: clean-preverified: clean-manifest: clean-jar: clean-jad: clean-javadoc: clean-j9: clean-ricoh: clean-semc: clean-savaje: clean-sjmc: clean-ojec: Deleting: /home/tester/NetBeansProjects/CdcApplication24/convert1373190330 post-clean: do-clean: deps-jar: pre-preprocess: do-preprocess: Created dir: /home/tester/NetBeansProjects/CdcApplication24/build/preprocessed Pre-processing 1 file(s) into /home/tester/NetBeansProjects/CdcApplication24/build/preprocessed directory. post-preprocess: preprocess: pre-compile: extract-libs: Created dir: /home/tester/NetBeansProjects/CdcApplication24/build/compiled do-compile: Compiling 1 source file to /home/tester/NetBeansProjects/CdcApplication24/build/compiled /home/tester/NetBeansProjects/CdcApplication24/src/cdcapplication24/Main.java:18: cannot access java.lang.Object class file for java.lang.Object not found public class Main implements Xlet { 1 error /home/tester/NetBeansProjects/CdcApplication24/nbproject/build-impl.xml:384: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 1 second) ---------------------------------------%<---------------------------------------
The problem above was caused by the missing symlink to the btclasses.zip which is easy fix on the emulator side (just make the symlink in the lib folder of the emulator by calling "ln -s ../btclasses.zip btclasses.zip" in the lib folder). Verified in the 6.9.1+patch2: Product Version: NetBeans IDE 6.9.1 (Build 201007282301) Java: 1.6.0_22; Java HotSpot(TM) Client VM 17.1-b03 System: Linux version 2.6.32-25-generic running on i386; UTF-8; en_US (nb)