How to compile a truly independent application?

Aftre having compiled my application to a class file on my computer, I tried to run it on another machine with the same OS as mine, but with a more limited class library. Instead of starting up like it did on my computer, the following printout wa spewed after running "java App":
Exception in thread "main" java.lang.NoClassDefFoundError: snoozesoft/systray4j/ SysTrayMenuListener at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$1
How would I compile the .java source so, that all the needed dependencies would be bundled together? I tried to create a .jar file, but it didn't seem to be any bigger than all the .class files combined when simply compiling using javac..

do you know what these classes are? I wouldn't think they would be in the java.* package hierarchy - some third party classes? If so, those things should be available in a redistributable jar, so include that in your own jar and you should be good.
Lee
PS: If you have to adjust the app's classpath you do that via a Class-Path entry in your manifest.mf file in your jar.

Similar Messages

  • How to compile forms and reports 6i in Application server 1.0.2.2.2.

    Hi all,
    i used oracle forms and reports 6i with oracle database 10g in client server architecture.
    now i want to make 3 tier, client-application server version 1.0.2.2.2-origin database serversystem on 3 separate machines.
    i have installed application server version 1.0.2.2.2.
    now i have my forms and reports 6i in application server computer.
    can any one please tell me how to compile forms and reports 6i in application server computer i.e do i have to write some extra code in forms and reports 6i in order to compile in application server computer successfully.
    waiting for an early reply.
    best regards
    fahad ejaz
    email:[email protected]

    ... another question would be why not upgrade those old Forms & Reports to the newest release 10.1.2.0.2 and use the latest Application Server to run them with?
    Release 6i and 1.0.2.2 is as you know desupported.
    Regards,
    Martin

  • How to compile my own applications

    Hello,
    I have been working through a book on J2ee, and getting on very well, apart from the fact that I cant create my own applications because I dont know how to compile them!!!
    Im used to just typing javac classsname.java, and it all gets done - I've tried this on my J2ee source files and I keep getting errors becasue the J2EE library classes I reference cant be found.
    I have been doing the exercises and examples that came with the book with no trouble, using asant to compile and build programs. I can use asant in this way with no problems, but that is becaause of a ready-cooked build.xml file and the works.
    Is asant the only way to compile J2EE apps, and if it is how do I go about using it for my own applications? Does it mean building my own build.xml file for each application I writeand then using asant as in the case of the examples?
    can javac not be used on its own to compile the application?
    Thanks for the feedback.

    Im used to just typing javac classsname.java, and it
    all gets done - I've tried this on my J2ee source
    files and I keep getting errors becasue the J2EE
    library classes I reference cant be found.J2EE library classes are in $J2EE_HOME/lib/j2ee.jar
    I have been doing the exercises and examples that came
    with the book with no trouble, using asant to compile
    and build programs. I can use asant in this way with
    no problems, but that is becaause of a ready-cooked
    build.xml file and the works.
    Is asant the only way to compile J2EE apps, and if it
    is how do I go about using it for my own applications?
    Does it mean building my own build.xml file for each
    application I writeand then using asant as in the case
    of the examples?
    can javac not be used on its own to compile the
    application?asant comes with predefined ant targets which has been found very useful. Check out the J2EE tutorial (http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html) and the J2EE-SDK samples bundle. You can also use ant and write your own targets. Check out J2EE BLuePrints applications (java.sun.com/blueprints) or the BLuePrints solutions catalog (https://bpcatalog.dev.java.net/). Hope this helps

  • How to Compile IMExample java application

    Hello,
    I did not find any readme.txt in the \demo folder.
    Can anyone help me on how to compile the IMExample application.
    THanks,

    Hello,
    I did not find any readme.txt in the \demo folder.
    Can anyone help me on how to compile the IMExample application.
    THanks,

  • How to compile your flex application for Iphone Using Adobe Flash CS5?

    How to compile your flex application for Iphone Using Adobe Flash CS5?

    I'm so sorry, I'm not really familiar with the codes.

  • How to compile and package my EJB application

    Hi,
    I just ran the sample programs from the Sun J2EE tutorial. Seems to work fine. I used the ant utility to compile all the programs and the J2EE Deployment Wizard to package and deploy everything. Now how do I compile and deploy a sample EJB program that I have written ?
    I am using the following platforms:
    1: JBuilder 3.0 : IDE (for writing the source code)
    2: JDK 1.4.0_01
    3: J2SDK EE 1.3.1 (EJB/Appln server)
    How do I make ant recognize my program and compile it... i guess the deployment procedure would still be the same.
    Can somebody please help me out on this ??
    Thanks
    prasanna

    Hi,
    Thanks for your prompt reply. I tried that out.. I have a directory called "customer" under which I have my interfaces,bean implementation class and the J2EE application client.
    ANT_HOME is set to : the directory where ant is installed
    JAVA_HOME is set to : the directory where JDK is installed
    J2EE_HOME is set to : the directory where J2EE server is installed
    and PATH : includes the bin directories of JDK, ant and J2SDK EE
    These are the paths I had to set when I ran the J2EE tutorial programs. It worked fine.
    Now when I say : ant myprogram I get an error saying:
    BUILD FAILED
    Target "myprogram" does not exist in this project
    How do I add my program also to the project so that ant can recognize it ?
    Also if there is any other way you can suggest to compile and package my application it would be great...
    Thanks
    prasanna

  • How to compile EBS application

    Dear all
    kindly confirm that how to compile EBS application , actually i want to compile all objects of EBS like forms , reports , library etc.
    Regards ,
    zulqarnain

    kindly confirm that how to compile EBS application , actually i want to compile all objects of EBS like forms , reports , library etc. You can do via adadmin or manually. Adadmin should be the best option since you want to compile all objects as the manual option would take long time.
    How To Relink Forms Library Files Using "adadmin" (11i & R12) [ID 141118.1]
    AD Command Line Options for Release R12 [ID 1078973.1]
    How to Generate a Specific Form Through AD utility adadmin [ID 178722.1]
    Troubleshooting Guide - invalid objects in the E-Business Suite Environment 11i and 12 [ID 1325394.1]
    You can find more details about adadmin in "Maintaining Oracle E-Business Suite Documentation Set".
    R12
    http://docs.oracle.com/cd/B53825_08/current/html/docset.html
    11i
    http://docs.oracle.com/cd/B25516_18/current/html/docset.html
    Thanks,
    Hussein

  • How to compile a single file in a project

    I have placed my java connector file called "xxxTargetconnector .class" in the below mentioned path
    D:\FSCM9DMO\webserv\FSCMDMO9\applications\peoplesoft\PSIGW\WEB-INF\classes\com\peoplesoft\pt\integrationgateway\targetconnector
    I have converted the above class file in to a java file using a decompiler.Now i would like to recompile the java file to get the byte code.This class file imports many class files from jar files which is placed in the below mentioned path.
    D:\FSCM9DMO\webserv\Cybersource.
    Before compiling i set the path to include the jar files
    for ex , set path = D:\FSCM9DMO\webserv\Cybersource
    For compilation i went to the below path using command prompt and compiled the particular file.
    D:\FSCM9DMO\webserv\FSCMDMO9\applications\peoplesoft\PSIGW\WEB-INF\classes\com\peoplesoft\pt\integrationgateway\targetconnector>javac xxxTargetConnector.java
    Unfortunately i got around 99 errors saying
    xxxTargetConnector.java:187: cannot find symbol
    symbol : variable Logger
    location: class com.peoplesoft.pt.integrationgateway.targetconnector.xxxTargetConnector
    How to compile a single file in a project ?

    According to [http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html], "As a special convenience, a class path element containing a basename of * is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR. I have never tried using this feature.
    So if all of your dependent classes are in in jar files that are in D:\FSCM9DMO\webserv\Cybersource, a command like the following should work.
    javac -cp D:\FSCM9DMO\webserv\Cybersource\* xxxTargetConnector.java
    Note that setting your operating system path variable has no impact on where Javac looks for dependent classes.

  • Pls help me on how to compile servlet

    pls i need the help of some kind one to assist me on how to compile and deploy servlet .I'm new to javaEE & am using the javaEE tutorial from sun site.In the first example servlet in d book, after compiling and deploying the greetingServlet and responseServlet and deployed it ,i was told to include a welcome jsp file in d war file. all these i have done but the server always complain of not been able locate d greetingServlet.
    i use the netbeans IDE and sun java application server.The greetingServlet & responseServlet codes are these; Pls I don't know what to put in the jsp file
    package servlets;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * This is a simple example of an HTTP Servlet.  It responds to the GET
    * method of the HTTP protocol.
    public class GreetingServlet extends HttpServlet {
        public void doGet(
            HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html");
            response.setBufferSize(8192);
            PrintWriter out = response.getWriter();
            // then write the data of the response
            out.println("<html>" + "<head><title>Hello</title></head>");
            // then write the data of the response
            out.println(
                    "<body  bgcolor=\"#ffffff\">"
                    + "<img src=\"duke.waving.gif\" alt=\"Duke waving\">"
                    + "<h2>Hello, my name is Duke. What's yours?</h2>"
                    + "<form method=\"get\">"
                    + "<input type=\"text\" name=\"username\" size=\"25\">"
                    + "<p></p>" + "<input type=\"submit\" value=\"Submit\">"
                    + "<input type=\"reset\" value=\"Reset\">" + "</form>");
            String username = request.getParameter("username");
            if ((username != null) && (username.length() > 0)) {
                RequestDispatcher dispatcher = getServletContext()
                                                   .getRequestDispatcher(
                            "/response");
                if (dispatcher != null) {
                    dispatcher.include(request, response);
            out.println("</body></html>");
            out.close();
        public String getServletInfo() {
            return "The Hello servlet says hello.";
    package servlets;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * This is a simple example of an HTTP Servlet.  It responds to the GET
    * method of the HTTP protocol.
    public class ResponseServlet extends HttpServlet {
        public void doGet(
            HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            PrintWriter out = response.getWriter();
            // then write the data of the response
            String username = request.getParameter("username");
            if ((username != null) && (username.length() > 0)) {
                out.println("<h2>Hello, " + username + "!</h2>");
        public String getServletInfo() {
            return "The Response servlet says hello.";
    }

    Here is what you will need to do.
    1. Compile the servlets by performing the following steps
    1.1 Open a command line in the directory where your servlets are located.
    1.2 Type the following commands
    1.2.1 javac GreetingServlet.java
    1.2.2 javac ResponseServlet.java
    Then you should see the .class files for these classes appear in the directory .
    Next you will put these class files in the WEB-INF/classes directory.
    Once you have done that you will edit your web.xml in the WEB-INF directory to include the two servlets. That code will look something like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <servlet>
              <servlet-name>GreetingServlet</servlet-name>
              <servlet-class>GreetingServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>GreetingServlet</servlet-name>
              <url-pattern>/GreetingServlet</url-pattern>
         </servlet-mapping>
         <servlet>
              <servlet-name>ResponseServlet</servlet-name>
              <servlet-class>ResponseServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>ResponseServlet</servlet-name>
              <url-pattern>/ResponseServlet</url-pattern>
         </servlet-mapping>
    </web-app>Once you have done this save the web.xml file and recompile the war file by following these steps
    1 open a commandline in the root directory where the servlets are
    2 type the following command jar -cvf warFileName.war .
    *Note the space and period at the end of the command are not a mistake the space . tells the jar tool to complie the war from the directory you are current in.
    Once this command is successfully ran you should see a .war file appear in the directory you are in. Then simply put the war file in your deploy directory of your server and you are finished.
    alternatly if you are just doing this for yourself to learn servlets and this is not going to be deployed anywhere then I would just use the W3C's Jigsaw server which does all the work for you all you have to do is compile the servlets and put the class files in the servlets directory and you are done.

  • How to Compile & Deploy the Java Concurrent Program File

    Hi,
    There is a requirement to create the Java Concurrent Program in Oracle eBusiness. I am able to create the Java Concurrent Program file. But unable to do the following things:
    1.Since it is custom file, which location I will deploy the file?
    2. How to compile the file?
    3. In the execution file path and executable file name what should I specify for JCP?
    Please guide me.
    Thanks

    Please see (How to register and execute Java Concurrent Program ?in Oracle Applications R11i ? [ID 186301.1]) for the complete steps (i.e. define concurrent program and add it to the request group, .etc.) -- This is also applicable to R12.
    You may also see:
    Classpath Setting of Third Party Jar Files in R12 Java Concurrent Program (JCP) [ID 1292694.1]
    Integrating Custom Applications with Oracle Applications [ID 176852.1]
    Java Concurrent Program FAQ [ID 827575.1]
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Program&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How do you find out what application is generating a plist file in your preference folder?

    I have had two similar warnings come up in Drive Genius 3, a program that I use to manage my drives.  The warnings occur during a daily verification of preferences on my main drive, a 256GB SSD. 
    They state:
    "The preference file at '/Users/me/Library/Preferences/com.analogsolutions.Football.plist' may be corrupted."
    "The preference file at '/Users/me/Library/Preferences/org.machinedevelop.National.plist' may be corrupted."
    Per Drive Genius' advisement, "Corrupted files can cause appplication crashes and should be moved to the Trash." I delete the files, however they are regenerated each day. 
    Q: How do you figure out what application is generating a preference file?  And is there a way to tell if this is a OS generated preference file? 
    I have searched online and cannot find any information about either Analog Solutions or Machine Develop nor am I able to discern what these particular .plist files are for... 
    Q: Are these two .plist files truly potentially harmful?
    Thanks for the Help!
    iMac
    model iMac12,2
    3.4 GHz Intel Core i7
    8 GB 1333 MHz DDR3

    Hi Everyone, sorry for the late response.  I have been monitoring my Preferences Folder; every moment I am on my computer trying to catch what application/process generates these files.  I was hoping to try your suggestions, but oddly enough the offensive .plist files have not returned since the last time I deleted them about a week ago.... strange...
    In any case, I have responded to some of your suggestions and questions that I have information on:
    X423424X wrote: Ok, can you double click the .plist file?  If so it should attempt to launch the Property List Editor (in your Utilities folder).  That way you can look at stuff in the plist.  Maybe (hopefully) there's something in there that can shed some light on who is creating it.   If Property List Editor cannot open the file (some apps create files that have the .plist extension but don't actually create the proper XML format -- probably what ProSoft was alluding to) then try opening it with a text editor.
    The .plist file when opened in text editor contains a string of (what to me seems to be) an arbitrary list of numbers.
    Linc Davis wrote: Those files have been given obfuscated names so you won't know what created them. They must contain encrypted registration data for some third-party commercial software that you use.
    Yes, seems likely...
    Linc Davis wrote: It should be fairly easy to find out what application is creating them, if you really care. Move the files to the Desktop, then log out. Log back in while holding the shift key as you click the "Log In" button. That will prevent your login items from loading, among other things. Open your account preferences and launch the login items one at a time by double-clicking them in the list. After each one, check to see whether the files have been recreated.
    Ran through login, one by one, no luck in identifying the application(s). 
    X423424X wrote: Another thought, lock the plists on the hope that whatever is using them will "choke" and complain about it (no guarantee that will work but worth a try).
    Thanks, the lock idea is the one I will try next if they ever reappear...
    X423424X wrote: Also, I don't recall if I asked this but if those plists are deleted while logged in will they be recreated during that same login session.  Or do they only appear after you deleted them and then and then logged out and back in?  Or do you have to reboot to recreate them?
    Unfortunately I do not know for certain.  Though from all my login/startup/reboot tests I believe that they are not directly linked to starting up the machine or loging in either.
    I'm not really certain why the .plist have not returned.  I haven't uninstalled any programs, though I did run a couple updates for some widgets within the last week; however that was about 3 days after I deleted the last set of .plist files and usually they reappered everyday.  In any case, given that they have not been regenerated I guess my problem is solved per se, at least I am no longer getting that annoying warning everyday.   Still, it's a bit of a mystery  
    Thanks again for all the help!

  • How to compile a form built in forms 10g on windows platform?

    Hi All,
    I have built a 10g form on my local desktop on windows 7 and compiled/deployed it in apps on linux server.
    I need to deploy the same form fmb on oracle apps hosted on windows platform. Please let me know if fmb works fine or not. And also provide how to compile form in windows platform..like frmcmp_batch command
    Thanks,
    Veena

    The fmb, mmb, and pll files are portable to any platform where Forms can be installed. Every installation that supports running Forms comes with the necessary components to generate the executible files (fmx, mmx, plx). On your Windows machine, if you have the Builder installed, you can generate an FMX using the Builder. If not, you can directly use the compiler. The compiler has a gui option and a command line option. If you do not pass any arguments into the executible (frmcmp.exe) the GUI will start. Alternatively you can generate from the command line (DOS). You may need to set PATH, ORACLE_HOME, TNS_ADMIN, and possibily some others in the DOS shell in order for it to work.
    If you have access to MyOracleSupport, refer to the following note:
    <blockquote>Moving Forms Applications From One Platform Or Machine To Another (Doc ID 299938.1)</blockquote>
    Example:
    <blockquote>frmcmp.exe module=myForm module_type=form userid=scott/tiger@orcl compile_all=yes</blockquote>
    More options are discussed in the Builder Online help and the compiler help.

  • How to compile and add my own protocol

    I want to send a sms without user intervention i have got a code from net which specifies a separate protocol for message.
    Now i am unable to compile it .I need a kmidp20.zip file for it.
    Can anyone tell me how to compile it.
    I need it very urgently for my application
    I am Sending u the code.I found it at the web page
    http://www.mobile-j.de/snipsnap/space/J2ME/Sending+SMS+from+MIDlet+without+user+intervention
    This certainly don't works since "xsms" is not an registered protocol.
    So we add this protocol to the package com.symbian.midp.io.protocol.xsms: (To compile the com.symbian.midp.io.protocol.xsms.Protocol class you will need the "kmidp20.zip" from the Nokia Series_60_MIDP_SDK_2_1 (I guess an other version will do also) in your classpath.)
    package com.symbian.midp.io.protocol.xsms;import com.symbian.gcf.*;
    import com.symbian.javax.wireless.messaging.SMSConnectionSession;
    import java.io.IOException;
    import javax.microedition.io.Connection;public final class Protocol extends ProtocolBase
    public Protocol()
    super("sms", "sms");
    public void ensurePermission(String aName)
    // do nothing � hehe
    } public Connection openConnection(URI aUri, int aMode, boolean aTimeouts)
    throws IOException
    if(aUri.toString().startsWith("xsms")){
    aUri = new URI(aUri.toString().substring(1));
    } com.symbian.gcf.ConnectionSession session = SMSConnectionSession.getSession();
    String host = aUri.getHost();
    ConnectionEndPoint connection;
    if(isServerConnection(aUri))
    connection = null;
    } else
    if(aMode == 1)
    throw new IllegalArgumentException();
    connection = new SMSClientConnectionImpl(session, aUri, 2);
    connection.open();
    return connection;
    } protected boolean isServerConnection(URI aUri)
    return aUri.getHost().length() == 0;
    and we need this in that package:
    package com.symbian.midp.io.protocol.xsms;
    import com.symbian.gcf.*;
    import com.symbian.javax.wireless.messaging.*;
    import com.symbian.midp.runtime.Security;
    import com.symbian.util.BlockingOperation;
    import com.symbian.util.NativeError;
    import java.io.IOException;
    import java.io.InterruptedIOException;
    import javax.wireless.messaging.*;class SMSClientConnectionImpl extends DatagramConnectionEndPoint
    implements MessageConnection
    {    SMSClientConnectionImpl(ConnectionSession aSession, URI aUri, int aMode)
    throws IOException
    super(aSession, aUri, aMode);
    iUri = aUri;
    iSendPermissionArgs = new String[2];
    } public final Message newMessage(String aType)
    String address = null;
    if(iUri.getHost().length() > 0)
    address = iUri.toString();
    return newMessage(aType, address);
    } public final Message newMessage(String aType, String aAddress)
    Message msg;
    if(aType.equals("binary"))
    msg = new BinaryMessageImpl(aAddress, 0L);
    else
    if(aType.equals("text"))
    msg = new TextMessageImpl(aAddress, 0L);
    else
    throw new IllegalArgumentException();
    return msg;
    } public final int numberOfSegments(Message aMsg)
    MessageImpl messageImpl = getMessageImpl(aMsg);
    int numberOfSegments = 0;
    synchronized(super.iCloseOperation.getLock())
    if(super.iState != 2)
    numberOfSegments = messageImpl.populateSmsData(super.iNativePeerHandle, 0);
    if(numberOfSegments < 0)
    numberOfSegments = 0;
    return numberOfSegments;
    } public final void send(Message aMsg)
    throws IOException, InterruptedIOException
    String address = aMsg.getAddress();
    if(address == null)
    throw new IllegalArgumentException("No address");
    URI uri = new URI(address);
    MessageImpl messageImpl = getMessageImpl(aMsg);
    synchronized(super.iWriteOperation.getLock())
    synchronized(super.iWriteOperation)
    synchronized(super.iCloseOperation.getLock())
    ensureOpen();
    iSendPermissionArgs[0] = address;
    int numberOfSegments = messageImpl.populateSmsData(super.iNativePeerHandle, 1);
    if(numberOfSegments < 0)
    if(numberOfSegments == -40)
    throw new IllegalArgumentException("Message too big");
    NativeError.check(numberOfSegments);
    iSendPermissionArgs[1] = Integer.toString(numberOfSegments);
    checkSecurity("javax.wireless.messaging.sms.send", iSendPermissionArgs);
    int status = send(super.iNativePeerHandle, EMPTYBYTE_ARRAY, 0, 0, address);
    checkError(status);
    super.iWriteOperation.waitForCompletion();
    checkError(super.iWriteOperation.getResult());
    } public void setMessageListener(MessageListener aListener)
    throws IOException
    throw new IOException("Must be Server");
    } public Message receive()
    throws IOException, InterruptedIOException
    throw new IOException("Must be Server");
    } private static MessageImpl getMessageImpl(Message aMessage)
    MessageImpl messageImpl = null;
    try
    messageImpl = (MessageImpl)aMessage;
    catch(ClassCastException ex)
    throw new IllegalArgumentException("Not from newMessage()");
    return messageImpl;
    } protected static void checkSecurity(String aPermission, String aPermissionArgs[])
    // Security.ensurePermission(aPermission, aPermission, aPermissionArgs);
    } protected static final int MESSAGE_TYPE = 0;
    private static final String MUST_BE_SERVER_MSG = "Must be Server";
    private static final String SEND_PERMISSION = "javax.wireless.messaging.sms.send";
    private static final int SEND_PERMISSION_ARGS_TOTAL = 2;
    private static final int SEND_PERMISSION_ARGS_URI_INDEX = 0;
    private static final int SEND_PERMISSION_ARGS_SEGMENTS_INDEX = 1;
    private static final byte EMPTY_BYTE_ARRAY[] = new byte[0];
    private URI iUri;
    private String iSendPermissionArgs[];}

    I want to send a sms without user intervention i have got a code from net which specifies a separate protocol for message.
    Now i am unable to compile it .I need a kmidp20.zip file for it.
    Can anyone tell me how to compile it.
    I need it very urgently for my application
    I am Sending u the code.I found it at the web page
    http://www.mobile-j.de/snipsnap/space/J2ME/Sending+SMS+from+MIDlet+without+user+intervention
    This certainly don't works since "xsms" is not an registered protocol.
    So we add this protocol to the package com.symbian.midp.io.protocol.xsms: (To compile the com.symbian.midp.io.protocol.xsms.Protocol class you will need the "kmidp20.zip" from the Nokia Series_60_MIDP_SDK_2_1 (I guess an other version will do also) in your classpath.)
    package com.symbian.midp.io.protocol.xsms;import com.symbian.gcf.*;
    import com.symbian.javax.wireless.messaging.SMSConnectionSession;
    import java.io.IOException;
    import javax.microedition.io.Connection;public final class Protocol extends ProtocolBase
    public Protocol()
    super("sms", "sms");
    public void ensurePermission(String aName)
    // do nothing � hehe
    } public Connection openConnection(URI aUri, int aMode, boolean aTimeouts)
    throws IOException
    if(aUri.toString().startsWith("xsms")){
    aUri = new URI(aUri.toString().substring(1));
    } com.symbian.gcf.ConnectionSession session = SMSConnectionSession.getSession();
    String host = aUri.getHost();
    ConnectionEndPoint connection;
    if(isServerConnection(aUri))
    connection = null;
    } else
    if(aMode == 1)
    throw new IllegalArgumentException();
    connection = new SMSClientConnectionImpl(session, aUri, 2);
    connection.open();
    return connection;
    } protected boolean isServerConnection(URI aUri)
    return aUri.getHost().length() == 0;
    and we need this in that package:
    package com.symbian.midp.io.protocol.xsms;
    import com.symbian.gcf.*;
    import com.symbian.javax.wireless.messaging.*;
    import com.symbian.midp.runtime.Security;
    import com.symbian.util.BlockingOperation;
    import com.symbian.util.NativeError;
    import java.io.IOException;
    import java.io.InterruptedIOException;
    import javax.wireless.messaging.*;class SMSClientConnectionImpl extends DatagramConnectionEndPoint
    implements MessageConnection
    {    SMSClientConnectionImpl(ConnectionSession aSession, URI aUri, int aMode)
    throws IOException
    super(aSession, aUri, aMode);
    iUri = aUri;
    iSendPermissionArgs = new String[2];
    } public final Message newMessage(String aType)
    String address = null;
    if(iUri.getHost().length() > 0)
    address = iUri.toString();
    return newMessage(aType, address);
    } public final Message newMessage(String aType, String aAddress)
    Message msg;
    if(aType.equals("binary"))
    msg = new BinaryMessageImpl(aAddress, 0L);
    else
    if(aType.equals("text"))
    msg = new TextMessageImpl(aAddress, 0L);
    else
    throw new IllegalArgumentException();
    return msg;
    } public final int numberOfSegments(Message aMsg)
    MessageImpl messageImpl = getMessageImpl(aMsg);
    int numberOfSegments = 0;
    synchronized(super.iCloseOperation.getLock())
    if(super.iState != 2)
    numberOfSegments = messageImpl.populateSmsData(super.iNativePeerHandle, 0);
    if(numberOfSegments < 0)
    numberOfSegments = 0;
    return numberOfSegments;
    } public final void send(Message aMsg)
    throws IOException, InterruptedIOException
    String address = aMsg.getAddress();
    if(address == null)
    throw new IllegalArgumentException("No address");
    URI uri = new URI(address);
    MessageImpl messageImpl = getMessageImpl(aMsg);
    synchronized(super.iWriteOperation.getLock())
    synchronized(super.iWriteOperation)
    synchronized(super.iCloseOperation.getLock())
    ensureOpen();
    iSendPermissionArgs[0] = address;
    int numberOfSegments = messageImpl.populateSmsData(super.iNativePeerHandle, 1);
    if(numberOfSegments < 0)
    if(numberOfSegments == -40)
    throw new IllegalArgumentException("Message too big");
    NativeError.check(numberOfSegments);
    iSendPermissionArgs[1] = Integer.toString(numberOfSegments);
    checkSecurity("javax.wireless.messaging.sms.send", iSendPermissionArgs);
    int status = send(super.iNativePeerHandle, EMPTYBYTE_ARRAY, 0, 0, address);
    checkError(status);
    super.iWriteOperation.waitForCompletion();
    checkError(super.iWriteOperation.getResult());
    } public void setMessageListener(MessageListener aListener)
    throws IOException
    throw new IOException("Must be Server");
    } public Message receive()
    throws IOException, InterruptedIOException
    throw new IOException("Must be Server");
    } private static MessageImpl getMessageImpl(Message aMessage)
    MessageImpl messageImpl = null;
    try
    messageImpl = (MessageImpl)aMessage;
    catch(ClassCastException ex)
    throw new IllegalArgumentException("Not from newMessage()");
    return messageImpl;
    } protected static void checkSecurity(String aPermission, String aPermissionArgs[])
    // Security.ensurePermission(aPermission, aPermission, aPermissionArgs);
    } protected static final int MESSAGE_TYPE = 0;
    private static final String MUST_BE_SERVER_MSG = "Must be Server";
    private static final String SEND_PERMISSION = "javax.wireless.messaging.sms.send";
    private static final int SEND_PERMISSION_ARGS_TOTAL = 2;
    private static final int SEND_PERMISSION_ARGS_URI_INDEX = 0;
    private static final int SEND_PERMISSION_ARGS_SEGMENTS_INDEX = 1;
    private static final byte EMPTY_BYTE_ARRAY[] = new byte[0];
    private URI iUri;
    private String iSendPermissionArgs[];}

  • How to compile .java to .class in .jar file

    Hey. I have code to make a .jar file, read .java files, and save them as .class files in the .jar file. When I open the .jar file, it says that the magic numbers on the classes are wrong. So I figured that Java must compile the .java files to .class files in bytecode.
    Question: What's the code to compile a string from a .java file to a .class file?
    Here's my code:
    try {
                // Name of jar file to write
                String archiveFile = Name + ".jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("Main.class"));
                StringBuffer sbuf = new StringBuffer();
                sbuf.append(readTextFromJar("Main.txt")));
                out.write(sbuf.toString().getBytes("UTF-8"));
                out.closeEntry();
                out.putNextEntry(new JarEntry("MainScreen.class"));
                sbuf = new StringBuffer();
                sbuf.append(readTextFromJar("MainScreen.txt"));
                out.write(sbuf.toString().getBytes("UTF-8"));
                out.closeEntry();
                out.putNextEntry(new JarEntry("GCanvas.class"));
                sbuf = new StringBuffer();
                sbuf.append(readTextFromJar("GCanvas.txt"));
                out.write(sbuf.toString().getBytes("UTF-8"));
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this, ex.toString(), "BUG!", JOptionPane.INFORMATION_MESSAGE);
                ex.printStackTrace();
            }Thanks,
    -Gandolf

    So I'm guessing that none of you guys have the knowledge on how to compile a java application within a java application. I was thinking that it had something to do with javac... but I'm unsure.
    If no one can answer the question, could someone point me to an expert who would know?
    -Gandolf

  • Webdynpro ABAP independent application

    hello,
    I have developed independent application of webdynpro ABAP
    i want to integrate it on portal
    i have page, create iview, assign application url to the iview - all this i do in portal content administration etc
    but in later versions, instead of iview etc, there is bankend transaction code, ie tcode in R/3 where I can assign my web dynpro application to portal
    I need the name of that transaction code. kindly help with your inputs
    thanks
    bhakti

    Hi Bhakti,
    AFAIK there is no such kind of facility available so that you can directly assign your webdynpro into the portal using any t-codes.
    But the SAP Enterprise Portal supports the Web Dynpro application development with functions like:
    Event handling of portal events
    Navigation between Web Dynpro applications within the portal or to any portal content
    WorkProtect mode
    And With Web Dynpro you create interactive Web-based user interfaces for business applications. The portal allows the role-based and secure access to different kinds of information (structured or non-structured), services, and applications using a Web Browser.
    For portal integration, refer the below document which will give you an idea.
    How to Integrate Web Dynpro  ABAP in Portal
    Thanks
    KH

Maybe you are looking for

  • Set password for messaging lumia 800

    hi, i have a nokia lumia 800 with windows phone 7.8. there is a way or application that can set password for messaging, when I or another person want to acces "messaging" it must to insert password, a pin with 4 digits for example. thank you! Solved!

  • Sorting question over state...

    Hi there, Anyone know where you amend the over state / hover of an option in a sorting question ??? Been looking in the object style manager but can't find it in there... Thanks in advance...

  • Common Practice For Storing Application Data Files

    During my application development targeting for XP and Linux time, I will store my application data files (Files where user may create, modify, rename, delete...) same path as my application directory. For instance, if my application is installed in

  • Error project not created...

    I am using below code in ombplus.. # Uses following variable set by OWBDemoInit script # owbclient # owbclientpwd # host # port # service # project puts "Project $project creating.." puts "STEP 1.." #OMBCONNECT REP_OWNER/REP_OWNER@pc-pc:1521:dev OMBC

  • HT5704 Ipad update

    I'm trying to download the iOS 6.1.3 for my Ipad 2, but an error shows in Itunes due to a connection timed out. Does anyone knows how to fix it so I can finally update my ipad?