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 190905 - Provide a new project template for main() execution
Summary: Provide a new project template for main() execution
Status: VERIFIED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: CDC pack (show other bugs)
Version: 6.x
Hardware: PC All
: P1 normal (vote)
Assignee: Petr Suchomel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 13:52 UTC by Martin Ryzl
Modified: 2010-10-27 07:38 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Ryzl 2010-10-11 13:52:14 UTC
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.
Comment 1 Petr Suchomel 2010-10-11 16:15:38 UTC
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.
Comment 2 Petr Suchomel 2010-10-15 13:19:56 UTC
fixed in http://hg.netbeans.org/main/rev/64a9e113dac9
Comment 3 Quality Engineering 2010-10-16 02:55:05 UTC
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)
Comment 4 Petr Suchomel 2010-10-16 19:33:37 UTC
Also http://hg.netbeans.org/main/rev/f06acc6bbba9 for broken test
Comment 6 Jaromir Uhrik 2010-10-26 08:33:39 UTC
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)
---------------------------------------%<---------------------------------------
Comment 7 Jaromir Uhrik 2010-10-27 07:38:42 UTC
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)