Specifying classpath in Sun CDC Toolkit

Hi All,
I am using Sun CDC Toolkit 1.0. i need to specify a jar in the classpath whose APIs are used by the application at runtime. i have tried using the "-classpath" option, but the APIs in the jar are not being found and i get a "java.lang.NoClassDefFoundError:" error.
D:\softwares\CDCTK10\bin\emulator.exe -classpath deleteme.jar -Xdevice:DefaultColorPhone -jar POC.jarjava.lang.NoClassDefFoundError: deleteme.DeleteMe
at Main.main(Main.java:15)
at java.lang.reflect.Method.invoke(Method.java:302)
at sun.misc.CVM.runMain(CVM.java:464)
deleteme.jar and POC.jar are both present in the current directory from where the command is being run.
The UserGuide mentions using "-classpath:" followed by the jar names, but this option is not recognized by the emulator.
Any pointers are greatly appreciated.
Thanks in advance,
-abhi

It turns out that the correct way to specify what i want is as follows:
D:\softwares\CDCTK10\bin\emulator.exe -classpath -Xdevice:DefaultColorPhone -cp POC.jar;deleteme.jar Main
where Main is the fully qualified classname of the main application class that is present in POC.jar
-abhi

Similar Messages

  • Sun Wireless Toolkit for CDC - JSR75 Application

    Hi All,
    I have Sun Wireless Toolkit for CDC installed in my machine. I have written a sample JSR75 application to access PIM database. At Compile time, it's giving so many compilation errors; it's not recognizing the PIM API.
    I have placed the jsr75.jar file in lib folder of CDC installation directory. At this time it's giving NullPointerException.
    Any body tell me how to access PIM API from Sun wireless Toolkit for CDC.
    Thank you very much in advance
    Thiru

    What platform do you use to develop? I use NetBeans and compilation works fine.
    I have the jsr75.jar in the following places (on old Apple iBook):
    /Users/carl/.netbeans/5.0/emulators/wtk22_linux/emulator/wtk22/lib/jsr75.jar
    /Users/carl/Library/mpp-sdk/jsr75.jar (for mpowerplayer emulator, but this does not work (yet))
    In the netbeans lib files also these jar-iles exist:
    cldcapi10.jar jsr082.jar midpapi10.jar wma11.jar
    cldcapi11.jar jsr184.jar midpapi20.jar wma20.jar
    j2me-ws.jar jsr75.jar mmapi.jar
    Carl.

  • Java.awt availability in CDC Toolkit ?

    Hi guys and girls,
    I've just tried out the Sun Java Toolkit for CDC 1.0 .. I tried making a simple app which uses awt components, such as Frame, Label, Button .. but the Label and Button just wont compile. I always thought that CDC has all the lib for the j2se's java.awt.
    Quoted from CDC FAQ :
    CDC currently supports three profiles. Foundation Profile provides basic application support APIs without any additional support for GUIs. Personal Basis Profile includes all of the APIs contained in Foundation Profile and adds support for lightweight AWT GUI components and the xlet application model. Personal Profile includes all of the APIs contained in Personal Basis Profile and adds support for full AWT compatibility and the applet application model.
    Do i miss something .. ? Please help pointing out for me ..
    I understand that there's swing from the AGui. So i tried making a new project with a simple class containing a simple JFrame, containing a JPanel which contains a button, which can be clicked to trigger a message type JOptionPane. But when the JOptionPane appears, it fills up the entire screen, i dont quite understand what is wrong.
    Here's the code :
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class HelloWorld {
          * @param args
         public static void main(String[] args) {
              final JFrame frame = new JFrame("Ahiak");
              final JPanel panel = new JPanel(new FlowLayout());
              JButton but = new JButton("Click Me !");
              panel.add(but);
              frame.getContentPane().add(panel);
              but.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        JOptionPane.showMessageDialog(panel, "hahah !");
              frame.setVisible(true);
    }Please show some compassion and click the reply button, lol -_-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I don't know about swing, but you can try using AWT and compile it with J2SE (set compliance to 1.4). The jar file should work on your mobile device with Personal Profile.

  • CDC Toolkit

    Hi all,
    I am trying to compile code I wrote for the J2SE in the CDC toolkit expecting some
    obvious errors for certain libraries that do not exist. Instead I am getting errors that
    it does not find the standard libraries. I set up the classpath to the appropriate JRE
    and any other jars the code requires. What else do I need to do?>
    Thanks much

    `What do you mean with some obvious erros that do not exist?
    CDC is still J2ME. There are some good limitations, but anyway is almost a full J2SE 1.4 compliant .
    For example if you are using enumerations, it wont work. And this is just one example, of lots of things that wont work!

  • What is directory where I can put in jar file without specify classpath ?

    hi,
    Is there any directory in weblogic similar to the directory of WEB-INF/lib/ where I can throw a jar file in without specify classpath explicitly.
    The reason I'm looking for such directory is :
    -- I do not want to specify classpath explicitly
    -- I'd like it outside of an application so that it stay even if the application redeployed.
    Thanks

    Hi Aacc,
    The domain library directory that you are looking for is usually $DOMAIN_DIR/lib, for example "C:\Oracle\WLS_Middleware10.3.4\user_projects\domains\test_domain_1\lib" (Windows) or "/u01/weblogic/domains/my_domain/lib" (Linux/Unix).
    The jars located in this directory will be picked up and added dynamically to the end of the server classpath at server startup. The jars will be ordered lexically in the classpath. The domain library directory is one mechanism that can be used for adding application libraries to the server classpath.
    You can override the $DOMAIN_DIR/lib directory using the -Dweblogic.ext.dirs system property during startup. This property specifies a list of directories to pick up jars from and dynamically append to the end of the server classpath using java.io.File.pathSeparator as the delimiter between path entries.
    -Cris

  • How to add jar files  classpath in sun stdio creator

    Hi,
    i am using log4j-1.2.13.jar in my application.
    how to add it to my classpath in sun stdio.
    with regards
    shannu sarma

    Hi there,
    These threads will answer your question
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=61842
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=56060
    Thanks
    K

  • Can I specify classpath in MANIFEST.MF of a ear file?

    Hi,
    I know that one can specify classpath in MANIFEST.MF of a jar file, I'd like to know whether I can specify classpath in MANIFEST.MF of a ear file?
    If yes, will the classpath specified affect all j2ee components in this ear file?(e.g. jar files,war files)
    Thanks

    Unfortunately, yes, you'd have to edit the MANIFEST.MF
    of each module within the .ear that has a dependency on
    the bundled library. One workaround is to add the common
    code to the server's classpath. However, that approach
    doesn't work if the common code has dependencies on the
    code packaged within the ejb-jars and .wars themselves.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to use third party APIs with Sun J2ME Toolkit

    I've installed Sun J2ME Toolkit 2.1. If I intend to use other third party APIs with my existing toolkit, how do I do that. I can manage to get the jar file of the associated API classes, but how to integrate the same with the toolkit. Thanks in advance to all who support.

    if I remember right, it is enough, if you put the .jar of the api in the lib/ directory of your project (<WTK>/apps/<yourProject>/lib/ )
    hth
    Kay

  • No such method found for com.sun.jndi.toolkit.url.UrlUtil: method

    Hello,
    I have a servlet which allow users to authenticate to IPlanet LDAP server. I have no problem to access it when it runs under a standalone Tomcate server but I have an internal error when it runs under Oracle8i server.
    The following error message was found in mod_serv.log file in \%OracleHome%\Apache\Jserv\logs folder:
    ajp12: Servlet Error: java.lang.NoSuchMethodError: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found.
    What is the problem? Where should I put my jndi.jar? Thanks.
    Regards
    CY Seah

    Hello,
    I have a servlet which allow users to authenticate to IPlanet LDAP server. I have no problem to access it when it runs under a standalone Tomcate server but I have an internal error when it runs under Oracle8i server.
    The following error message was found in mod_serv.log file in \%OracleHome%\Apache\Jserv\logs folder:
    ajp12: Servlet Error: java.lang.NoSuchMethodError: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found.
    What is the problem? Where should I put my jndi.jar? Thanks.
    Regards
    CY Seah

  • Looking for com.sun.jndi.toolkit.url.Uri.class

    Does anybody have any idea where I can find com.sun.jndi.toolkit.url.Uri.class?

    Ah well...I found it. Not seperate from the provider classes but I did finally find it. It is in the providerutil.zip that is included with the LDAP Service Provider download. The download is available at: http://java.sun.com/products/jndi/#download

  • Sun Java Toolkit 1.0 for CDC on Linux

    I am looking to develop of my system to run on a PDA or one of the other more powerful J2ME platforms. From what I've read the Toolkit for CDC is what I need. I would like to use swing (if possible) and the platform must have WiFi access to a server (which will be running the J2EE (JBoss) application). So my target device must support J2EE client functionality.
    The download site only as a Windows EXE, but as a long time Solaris (and now Linux) hack I don't have a Window system to develop upon. Is Sun planning a version of the toolkit for Linux?
    If not is there a way I could bring the J2ME Wireless Toolkit up to the specification I need? I download that and had little problem developing a MIDlet that I deployed to my Mobile phone. I even played with the emulator and created a generic target device with a QVGA screen as I haven't got any target hardware yet.
    Thanks for any and all help
    Steve

    I'm also interested in how to develop CDC applications under linux...
    Edited by: nokia87 on Jan 16, 2008 2:06 AM

  • Loading a class from specified classpath

    Hello,
    I would like to create an instance of a class in a specific directory.
    So, I am doing this way :
    System.setProperty("java.class.path", classPath.getAbsolutePath());
    Class object = Class.forName(name);
    Object instance = object.newInstance();It works perfectly when running in my IDE (Eclipse).
    But when I am running my application through a JAR, I encountered the following error :
    ClassNotfoundException
    I don't understand why an exception is thrown whereas I defined correctly my classpath.
    Could you help me ?

    When running from an executable jar the normal class path is ignore in favour of thejar and any Class-Path specified in the jar's manifest.
    What you want is a URLClassLoader. Bascially:
    URLClassLoader cl = new URLClassLoader(new URL[]{classPath.toURL()});
    Class clazz = cl.loadClass(fullName);(Catch assorted exceptions)
    There should not be a class of the given name in the jar, or libraries it references (if there is, that will be loaded in preference).

  • JNI: How to specify classpath?

    Currently I have a working C app that calls a function in a java class whose .class file is in the same directory as the C executable. I would like to place the class file in another directory and still be able to run the C code. How is this done? I have tried setting the classpath environment variable and have also tried specifying the -Djava.class.path option in the JavaVMOption array. Neither method has been successful. Has anyone gotten this to work on a linux machine?
    Thanks, Andreas

    Something like this should work:
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    /* Set the classpath, if the classes are in a jar file include the jar filename
    in the classpath */
    options[0].optionString = "-Djava.class.path=c:\myclasses;c:\my.jar";
    vm_args.version = JNI_VERSION_1_4;
    vm_args.options = options;
    vm_args.nOptions = 1;
    Note that if your classes are in a jar file, you need to include the jar file in the classpath.

  • CLASSPATH for Sun Application Server

    Hello
    I created a JAXRPC Webservice which uses the DataSource class. When I connect to it via my test client I see a NoClassDefFoundException: javax/activation/DataSource. The class is in the activation.jar and I added it everywhere I could (classpass, post and prefix in Webadmin and I set it on the command line). I'm using Sun Solaris 8. The stack trace looks like this:
    java.lang.NoClassDefFoundError: javax/activation/DataSource
    at java.lang.ClassLoader.findBootstrapClass(Native Method)
    at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:709)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:284)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at com.sun.enterprise.util.ConnectorClassLoader.loadClass(ConnectorClassLoader.java:158)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1348)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at com.ascom.srv.web.FileDistributorImpl.getFile(FileDistributorImpl.java:53)
    at com.ascom.srv.web.FileDistributorIF_Tie.invoke_getFile(FileDistributorIF_Tie.java:91)
    at com.ascom.srv.web.FileDistributorIF_Tie.processingHook(FileDistributorIF_Tie.java:183)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:228)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:316)
    at com.sun.enterprise.webservice.JAXRPCServlet.doPost(JAXRPCServlet.java:49)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:768)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
    at org.apat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)ache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
    at java.lang.Thread.run(Thread.java:534)
    Does any one have an idea what the problem is?
    Thank you very much in advance
    Oliver Jaun

    Thanks. Yes I restarted the application service. I even removed the "ignore environment classpath" from the classpath configuration of appserver and set the classpath on the command line. Without success.
    I will try to use the jwsdp because I found out that wscompile delivered with jwsdp is a newer version than with the one delivered with appserver and I had some weired problems compiling my WSDLs...
    Thanks a lot
    Oliver

  • Error:access SQL Server thru java prg without specifying classpath at runti

    Hi!
    The prg is trying to connect to a remote Sql server Db . The prog is complied by specifying the path of sql drivers. When it is run
    1)java -classpath pathofsqldivers classnm param1 param2
    its working fine
    2)java classnm param1 param2
    its giving the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/microsoft/jdbc/sqlserver/SQLServerDriver
    when i am using this class in servlet its giving the same error, there i cannot specify the runtime -classpath option as i m instanttaiting an object of the above mentioned class.
    plse help me out

    In case you are having a webapplication ...put your driver jar and class in which you connect to the db in WEB-INF/lib of your application
    or else set the jar file in the CLASSPATH variable
    hope this helps:)

Maybe you are looking for