Results 1 to 7 of 7

Thread: add classes

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Location
    Mesa, Arizona
    Posts
    45

    add classes

    How do you add the classes so the import statment recognizes them. I'm building wireless apps targeting the J2ME runtime. I have it installed but these import statements are erroring out.


    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    is there some sort of preference that I need to add? I running netbeans 3.5.1 for the IDE

  2. #2
    Hyperactive Member -=XQ=-'s Avatar
    Join Date
    Mar 2002
    Location
    Liverpool, England, UK
    Posts
    278
    Try downloading the J2ME toolkit from Sun... compiles projects for me OK. http://java.sun.com/products/j2mewtoolkit/download.html
    See ya later,

    -=XQ=-

    "Reality is merely an illusion, albeit a very persistent one. "
    - Albert Einstein (1879-1955)
    This is the coolest site ever!!!

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    In addition to that you need to set the bootstrap classes with the -bootstrap compiler option.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    CornedBee might be right. The primordial or bootstrap classloader will search in the locations(directories and zip/jar files) specified in the sun.boot.class.path system property.

    As far an i understand it the java core classes are loaded by the primordial classloader and application specific classes are loaded by the system (or application) classloader.

    After dowloading the JCE i remember having to add locations to my classpath but no bootstrapping was done.
    Last edited by Dilenger4; Sep 25th, 2003 at 10:53 PM.

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2002
    Location
    Mesa, Arizona
    Posts
    45
    So how do I set up this -boostrapper and classpath properties

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    javac -bootclasspath "path\to\j2me\bootstrap.jar" -classpath"path\to\classes;path\to\other\classes.jar" mymicroapp.java

    etc...
    Last edited by CornedBee; Sep 25th, 2003 at 03:02 PM.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Actually I used a bunch of batch files and installed them as a tool in EditPlus, worked really well, except that I manually had to edit one file every time...

    builmeapp.bat
    Code:
    @echo compiling...
    @call d:\work\java2\bin\javacme.bat @%1.jmk -g -d tmpclasses
    @echo preverifying...
    @call d:\work\java2\wtk\bin\prever.bat
    @echo packaging...
    @call d:\work\java2\wtk\bin\jarme.bat %1
    @dir %1.jar
    javacme.bat
    Code:
    @javac -bootclasspath d:\work\java2\wtk\lib\midpapi.zip %1 %2 %3 %4 %5 %6 %7 %8 %9
    prever.bat
    Code:
    @d:\work\java2\wtk\bin\preverify.exe -d classes -cldc -classpath d:\work\java2\wtk\lib\midpapi.zip tmpclasses
    jarme.bat
    Code:
    @jar cfm %1.jar %1.manifest.txt -C classes . -C res .
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width