How to create a .java file through a j2me program?

I am trying to develop a small application in j2me which needs dynamic creation of a .class file. For this purpose I tried to create .java file through my j2me code, but i could not do that..I want to know whether a java file can be created on a mobile phone or not..
I would be grateful to you on your help in this regard..

...develop a program xyz.java using j2me which performs the following functionalities:
1.create a file called abc.java
2.extract its class file...For +1+ ie to create a file (any file, no matter java or not) from j2me, device need to support File Connection specified in [jsr 75|http://www.jcp.org/en/jsr/detail?id=75]. If you're interested, learn the jsr API on how to create and manage needed file.
For +2+ described as extract its class file one needs to have java compiler (javac) on device. *) If you're interested, ask for more details at [Java Compiler forum|http://forums.sun.com/forum.jspa?forumID=7]. Also, if the class file is for CLDC then javac needs to support "JDK 1.3-compliant" compilation. To create CLDC classes on device, one also needs to have a preverifier tool. Check this at Java Compiler forum if needed.
Good luck - I think you'll need a lot of it...
*) javac on device -- it should not only be present but also provide a j2me API allowing to invoke it for particular java file with needed options. Same applies to preverifier tool.

Similar Messages

  • How to Create a text file through Portal

    Hi,
    Is there any way to create a text file(e.g Excel file) through Portal? Thanks.
    Sumita

    I have a way to do this in VBScript, I don't know if it will work with the portal but the steps are simple. If you can create a text file within portal, try to create it as an html table:
    <table>
    <tr>
    <td>Column Header 1</td>
    <td>Column Header 2</td>
    </tr>
    <tr>
    <td>Value 1</td>
    <td>Value 2</td>
    </tr>
    <tr>
    </tr>
    </table>
    When you create this file save it with XLS extension instead of TXT, create a link to it and voila! it will load Excel and you will have your data well formatted. I found this method rather better than save the file as a CSV. You can also include any html attribute inside the <TD> or <TR> like background color and font type, Excel will keep those attributes.
    I hope this will help
    Arturo

  • How to create a .java file with multiple classes

    I have all the below classes declared in a file say ABC.java under
    a common package called somepackage
    Abstract class A
    Void abstract metod1();
    Void metod2();
    Class B
    void method3();
    Void method4();
    Class C
    void method1();
    Void method2();
    In Client.Java
    On compiling the Client.Java I get errors
    Import somepackag.*;
    Class Samp extents A
    void Method1()
    Public class Client
    A a1 =new Samp(); //error undeclared class A
    B b1 = new B1();//error undeclared class B
    C c1 = new C1();//error undeclared class C
    is it possible to have all the class declared in one file ( i dont need mutiple classes, as this file will be autogenerated , i need all classes in one file) and use the classes inside this in the some client app
    regards
    MP

    Peetzore wrote:
    As long as you have only one public class and your .java file is named after it you shouldn't have any problem.I did exactly that, but still i get the same error "Cannot find symbol"
    i have used the import command on top as import somepackage.*;
    Edited by: mpjava on Jun 2, 2009 1:29 AM
    Edited by: mpjava on Jun 2, 2009 1:30 AM

  • How to create a java file from an xml file

    anybody who can help me? i'm really trying to get this job in a hurry..thanks

    wondering if velocity template engine can help.
    a. parse XML
    b. construct bean (will XMLBeans help?)
    c. write java files (velocity may have helped here) from predefined template.
    Looking forward to other suitable solution.
    JSP to servlet is, I guess, such example.

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • How to create a text file or XML file  and add content through  code into it...

    Hi Everyone,
    How to create a text file and add content through the code to the text file eform javascript ......orelse can we create a text file in life cycle designer...
    Else say how to create a new XML file through the code and how some content like Example "Hello World".

    You can create a text file as a file attachment (data object) using the doc.createDataObject and doc.setDataObjectContents:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.450.html
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.528.html
    You can then export the file with the doc.exportDataObject method:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.463.html
    This won't work with Reader if it hasn't been given the file attachment usage right with LiveCycle Reader Extensions.

  • How to create the exe file for java project.

    How to create the exe file for java project.
    am done the project in java swing , i like to create the project in exe format, so any one help for me,
    send the procedure for that.
    thanking u.

    How to create the exe file for java project.Have you ever heard of google? I pasted your exact "question" into a google search:
    http://www.google.com/search?q=How+to+create+the+exe+file+for+java+project.
    and got several useful links.
    Better search terms might yield even better results.
    Sheesh.

  • How to create an Oracle DATABASE through Java Programming Language.. ?

    How to create an Oracle DATABASE through Java Programming Language.. ?

    Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
    In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
    So a certain amount of manual installation will always be required.
    Typically you would supply the SQL scripts, and a detailled installation document too.
    regards,
    Owen

  • How to create the exe files for java application

    How to create the exe file for java application?
    got any software to do that?
    Thanks

    In terms of converting java applications into exe files, there are 3 schools of thought:
    1) Instead of converting it to an exe, convert it to a jar file. Jar files are more portable than exe files because they can be double-clicked on any operating system. The caveat is that a Java interpreter must be installed on the target computer for the double-clicking to work.
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/
    2) Create an exe launcher that, when double-clicked, attempts to find a Java interpreter on the local computer and launches the Java application. The exe file is still double-clickable but whether your java application runs depends on whether a Java interpretor is installed on the target computer.
    http://www.sureshotsoftware.com/exej/
    http://www.objects.com.au/products/jstart/index.jsp
    http://www.duckware.com/products/javatools.html
    http://www.ucware.com/jexec/
    http://www.rolemaker.dk/nonRoleMaker/javalauncher/
    http://www.jelude.cjb.net/
    http://thor.prohosting.com/~dfolly/java/index.html
    3) Create an exe launcher that bundles a Java interpretor. Same as above but when the exe file is double-clicked, it searches for a Java interpreter and if one is not found, it installs one on the target computer. The caveat is that the exe file would have an overhead of 10 MB in size for the interpreter.
    http://www.excelsior-usa.com/jet.html (evaluation version available)
    4) Convert the Java application into a native exe file. The caveat is that if you use Swing for your GUI, it won't be converted. Also this option is still somewhat experimental.
    Can't think of any free options right now.

  • How to create a CSV file in java

    how to create a CSV file in java

    this is the code that I have used in a hp project:
    private static final String DELIMIT = ",";
    StringBuffer buf = new StringBuffer();
    public void addString(String str){
    buf.append(toEscapedStringLiteral(str.replaceAll(" ","").trim())).append(DELIMIT);
    public void sendFile( String strData ,
                                String strTitle,
                                String strContType,
                                HttpServletResponse res ) throws IOException {
              byte[] _filedata=strData.getBytes();
              res.setContentType( strContType );
              res.setHeader( "Content-Disposition", "attachment;filename="+ strTitle );     
                     DataOutputStream out = new DataOutputStream( res.getOutputStream() );
              out.write( _filedata, 0, _filedata.length );
              out.close();
    public void addStringWhithReturn(String str){
              buf.append(toEscapedStringLiteral(str.replaceAll(" ","").trim()));
              buf.append( "\n" );
    private String toEscapedStringLiteral( String charSeq ) {
              if ( null == charSeq ) {
                   charSeq = "";
              return "\"" + charSeq + "\"";
    ....hope its help
    kou

  • How to create different log files for each of web applications deployed in OC4J

    Hi All,
    I am using OC4J(from Oracle) v1.0.2.2 and Windows2000. Now I want to know
    1. how to create different log files for each of my deployed web applications ?
    2. what are the advantages in running multiple instances of oc4j and in what case we should run
    multiple instances of OC4J ?
    3. how to run OC4J as Windows2000 Service rather than Windows2000 Application ?
    Thanks and Regards,
    Kumar.

    Hi Avi,
    First of all I have given a first reading to log4j and I think there will some more easy way of logging debugging messages than log4j (If you could provide me a detailed explanation of a servlet,jsp,java bean that uses log4j and how to use log4j then it will be very helpful for me). The other easy ways (if I am not using log4j) to my problem i.e creating different log files for each of web applications deployed in oc4j are
    I have created multiple instances of OC4J that are configured to run on different ports and so on each instance I have deployed a single web application . And I started the 2 oc4j instances by transferring thier error/log messages to a file. And the other way is ..
    I have download from jakarta site a package called servhelper . This servhelper is a thread that is started in a startup servlet and stopped in the destroy method of that startup servlet. So this thread will automatically capture all the system.out.println's and will print those to a file. I believe that this thread program is synchronized. So in this method I need not run multiple instances of OC4J instead each deployed web application on single instance of oc4j uses the same thread program (ofcourse a copy of thread program is put in each of the deployed web applications directories) to log messages on to different log files.
    Can you comment on my above 2 approached to logging debugging messages and a compartive explanation to LOG4J and how to use LOG4J using a simple servlet, simple jsp is appreciated ...
    Thanks and Regards,
    Ravi.

  • How can i execute "*.java " files in Workshop

    Hi,
    Im sunil,new to this weblogic workshop8.1..i dont know how to execute standalone .java files or servlets in workshop.plz help me and tell the way.
    regards
    Budati sunil

    Im not too sure about the Java project. But single normal java files with public static void maain(String [] args) are very simple to execute.
    1. Write the java code somewhere lets call this class A.
    2. Make a dummy page flow.
    3. In the begin action of this pageFlow, call the main method of the A class directly using A.main(null) since main is a static method. your code will work fine.
    4. If you have to pass a String[] as parameters. Before calling main, create this String[] and then pass it.
    In this way you can make a jsp and take the input from the user also.
    Hope it helps
    Cheeers

  • How to create a PAR file in Web Dynpro

    Hi !!
    Could any one tell me how to create a par file of the java application developed in WebDynpro..
    thanks
    ChandraSekar Maheswaran

    Hi,
    Refer the link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/a-c/creating%20your%20first%20web%20dynpro%20application.pdf
    Webdynpro concepts
    Regards,
    Tamil K

  • How to compile a java file which is in memory?

    how to compile a java file which is in memory?
    such as:
    String s="class MyClass {....}";
    how to compile the string?
    thx

    come on ...That was a perfectly valid solution.
    Do you know how to call the sun.* compiler? If not then search the forums for it. If that interface still exists (which it might not in newer versions) you then will create a string stream from your class and pass it to that.

Maybe you are looking for