Can java create unique filenames?

DataOutputStream out = new DataOutputStream(new FileOutputStream(fileName));
String fileName = "c:/" + Integer.toString(stuff) + ".txt";
out.write(stuff);
The reason that this is important, is because I want to be able to create a unique filename each time I run the program (which records important data). I dont want the data overwritten within the same file over and over again.
currently my program looks like this:
DataOutputStream out = new DataOutputStream(new FileOutputStream("c:/data.txt"));
out.write(stuff);
each time I run the program however, the data.txt file will just get overwritten. How can I make my program resemble the one above without Java rejecting the codeing?

I defer to DrClap - it does seem to work. Usingthe following codeimport java.io.*;
public class Test {
    public static boolean createTempFile (String prefix, String suffix) {
        try {
            File.createTempFile(prefix, suffix);
        catch (IOException e) {
            return false;
        return true;
    public static void main( String [] args ) {
        System.out.println(Test.createTempFile("foo", "bar"));
        System.out.println(Test.createTempFile("bar", "foo"));
        System.out.println(Test.createTempFile("foo", "bar"));
}I get files of the form
fooNNNNNbar created. So my question is when would his EVER throw an IOException?

Similar Messages

  • How can I create unique partnerships to deal with like EDI messages?

    I have an EDI to Application partnership setup currently that deals with translating MEDRUC type EDIFACT messages to a mainframe format. The setup is
    Sender = PARTNERA,
    Receiver = PARTNERB
    DocType = MEDRUC.
    In the Input EDI tab the
    Sender Qualifier ID = ZZ:PARTNERA
    Receiver Qualifier ID = ZZ:PARTNERB
    Standard = EDIFACT
    Version = D
    Release Number = 97B.
    Use UNG to locate partnerships = No
    EDIFACT messages contain all this information in their UNB and UNH segments which is where SunONE IS B2B looks to then match against the relevant partnership. My problem is this does not go to enough granularity for me to distinguish uniqueness for the second partnership I need to create.
    The problem is the "Association assigned code" field in the UNH for EDIFACT messages is not catered for anywhere in the partnership details area. This means then that whilst my existing partnership deals with Simplified Billing Claim MEDRUC's which is Association assigned code = SBC20, I can't create an EDI to Application partnership for PARTNERA and PARTNER B to cater for Two Way Gap Claiming MEDRUC's which are Association assigned code = TWC10, ie the two messages are D97B MEDRUC type messages only distinguished from each other by this Association assigned code.
    Any ideas how can I then create a unique EDI to Application partnership for this TWC10 MEDRUC message?
    What I am thinking I will have to do is make this second partnership Application to Application and create a custom service to wrap the MEDRUC message with a HREC/TREC and use the parameters in the HREC to dictate the DocType rather than use the UNB/UNH segments in the MEDRUC?

    Hmmm. It looks like way back when the decision was made on how specific the keys had to be, they didn't get quite specific enough for your case. I'm not super experienced with EDIFACT but I'll throw out some suggestions based on my HREC and X12 knowledge.
    A. Could you handle both instnaces through the same partnership, but alter the map to create unique outputs based on the two different types? At least of the cards would need to be handled through Route, but you could have that picked up by a simple Outprep / Gateway Service list that put the data where you wanted it.
    B. Before Parse, run a custom service that is capable of inspecting for which type of data it is, then modify one of the key fields in place to find the Second partnership. Really getting adventurous, maybe you could alter keys in the UNG to make the distinction. This assumes that you don't have both types of documents in the same interchange.
    C. Your idea may be workable. Can you give some more detail on the make-up of the Service list and the destination/processing of the two differnt types of MEDRUC?
    Thanks.

  • Help: Can I create unique content in Dreamweaver and host it on Adobe?

    I have been told that I cannot do this and I am asking for verification.
    I am a CC subscriber so I have five Adobe hostings available.
    What I want to know:
    Is it correct that when I purchased the CC subscription and Dreamweaver with five site hostings, I cannot use Dreamweaver to create unique content and host it on the five hostings?
    Why would Adobe sell Dreamweaver with all it’s capabilities and not support using it on the hostings that are sold as part of the package?
    What I want to do:
    Create very simple, unique content in Dreamweave. No commerce, just pages.
    Publish it (test site is OK) to one of my available Adobe hostings.
    Have it look just like I created it without any Business Catalysts templates or content.
    What I have been told:  
    My five Adobe hostings are in Business Catalyst
    I have to use Business Catalyst templates or my web site will not work
    I cannot create unique content in Dreamweaver and use my Adobe hostings to post content entirely of my own design. I must conform to Business Catalyst.
    What I have experienced:  
    I can create my content in Dreamweaver.
    When I try to create a new Business Catalyst site in Dreamweaver using my content, Dreamweaver wants to download the lorem ipsum prefabricated placeholder content and overwrite my work.
    I can mitigate this by unchecking a box but it won’t allow me to use my content.
    When I push up (put) my content, it appears to transfer up
    After a few seconds, the files on the server are zroed out (zero byte size).
    My content is not on the web server.
    What I have not tried but will do next:
    Create a New Business Catalyst Test site in Dreamweaver.
    Allow Dreamweaver to download the site content.
    Strip out all of the prefabricated junk.
    Build my content.
    Push (put) it up.
    See if it works.
    This is a pain.

    Hey there, Please see my replies to you in another colour below:
    I have been told that I cannot do this and I am asking for verification.
    Adobe - No, Business catalyst - yes. Adobe is not Business Catalyst, Bussiness Catalyst is owned by Adobe and is a website CMS sollution and hosting for that.
    I am a CC subscriber so I have five Adobe hostings available.
    Business Catalyst WEB BASIC sites
    What I want to know:
    Is it correct that when I purchased the CC subscription and Dreamweaver with five site hostings, I cannot use Dreamweaver to create unique content and host it on the five hostings?
    No of course you can, You build your site as you want and upload to BC. You just need to note that the sites will be only the web basic plan so limited features.
    Why would Adobe sell Dreamweaver with all it’s capabilities and not support using it on the hostings that are sold as part of the package?
    Dreamweaver has full integration with Business Catalyst - You have been told incorectly.
    What I want to do:
    Create very simple, unique content in Dreamweave. No commerce, just pages.
    Totally fine
    Publish it (test site is OK) to one of my available Adobe hostings.
    Get out of your head "Adobe hosting" it is Adobe business catalyst
    Have it look just like I created it without any Business Catalysts templates or content.
    If you have raw static html and css files etc in pages - this will work. This is the wrong way to build a site but you can do so if you want to.
    What I have been told: 
    My five Adobe hostings are in Business Catalyst
    Yes that is correct
    I have to use Business Catalyst templates or my web site will not work
    Not true. Now there are templates you can use to build your sites. The other "template" term you will here are the templates you use in your site builds, pages and other elements use - Layout control - change once, update many.
    I cannot create unique content in Dreamweaver and use my Adobe hostings to post content entirely of my own design. I must conform to Business Catalyst.
    The concept of creating content in Dreamweaver is not correct. You should be desining your site and then build it in Dreamweaver and then you manage the content using Business Catalyst.
    What I have experienced: 
    I can create my content in Dreamweaver.
    You can but you shouldnt, you should build the site elements in DW.
    When I try to create a new Business Catalyst site in Dreamweaver using my content, Dreamweaver wants to download the lorem ipsum prefabricated placeholder content and overwrite my work.
    I do not use DW to build my BC sites so not sure what is happening there. It shouldnt, sounds like your syncing not uploading files.
    I can mitigate this by unchecking a box but it won’t allow me to use my content.
    To remove the cross syncing for the web basic creative cloud sites for people in muse there is an option in Site settings you need to tick, I am guessing you need to do this too.
    After a few seconds, the files on the server are zroed out (zero byte size).
    You will need to contact Business Catlayst support on this one

  • Can Java create HTML tables without running a web server?

    Hello,
    I would like to know if Java can output data into a simple HTML-like table without having to run a web server or jsp etc.
    I want my program to access a database and print records in HTML-like table cells.
    It is actually for an events calendar program, where each event would be printed in a cell (date). There would be a variable number of events per cell (date), with each one being editable.
    I have seen various "web" calendars like this but I want to make it a desktop application so that it is not dependant on the functioning (or non-functioning!) of a web server.
    Can Java do this? I would settle for any type of prewritten table creator (not necessarily HTML) but I do not want Excel type tables or a table where entries must be GUI buttons, such as in Outlook.
    Thank you very much for any idea you may have,
    Cat

    Thank you for the replies :)
    I found something with Jeditorpane (JTextComponent and HTML Text Display) at
    http://msp-of.de/oreilly/books/javaenterprise/jfc/ch03_21.htm
    which looks like what I want. It allows hyperlinks within the table cells and I'm not sure if JTable allows for that. Also, I will want multiple lines and even images (eg moon phases for the calendar) in each cell. I ran the example above and it works great. And yes, it makes use of the HyperlinkListener.
    I don't want to create an HTML file for those who suggested that. I just want the flexibility of HTML formatting withing my standalone Java application.
    I am still not sure why everyone is suggesting JTable though :) So I will look at it some more. The link above also has a turorial on JTable and does say its faster that JEditor pane because it doesn't have to do any HTML rendering. But it doesn't look to me like it can really ever look like a calendar.....
    Thank you again! Being a total Java novice, I am very impressed with how easy JEditorpane is.
    Cat

  • If I buy the unlimited Form Central, can I create unique user areas

    If I buy the unlimited Forms Central subscription can I assign specific and unique usernames/passwords so that each of my clients can log in and only see thier own forms and no one else's?

    You can create FormsCentral forms for clients, but they will need to establish their own accounts to use the forms. This was discussed recently here: http://forums.adobe.com/thread/1151626
    To answer your question, you can limit access to the form design and results table to certain individuals. You can assign the roles of co-author, contributor, or reader to individual users. There are a number of sharing options that you can read about in the FormsCentral Help document.

  • Create unique filename by auto-incre​ment path

    I needed a program that would take in a pathname, see if the file name already existed at that location, and if so it needed to auto-increment the file name. I wanted it to work the way windows inherently does when you copy a file of the same name into a location because that seems the most natural to me. I was running into problems with the ftp functions in the internet toolkit becaues if the local file already exists at the path you input, it just doesn't perform the get files function.
    I discovered after searching the forums that a lot of people run into this all the time and usually the way they get a unique file name is by adding the date and time to the end of the file. This is both effective and informative, but results in unnecessarily long and ugly file names. 
    So I made a subVI and I wanted to share it with you guys. Hope someone finds it useful. Let me know what you think.
    [will work for kudos]
    Attachments:
    Unique File Name.vi ‏34 KB

    I took your suggestions
    - appended (T) to the check existence input description to indicate its default position
    - Created a "New Path?" output that idicates whether a new path was created (T) or if the inputted path was simply passed through (F)
    And for all the users who dont have 2009... Here are some older versions for you
    enjoy
    [will work for kudos]
    Attachments:
    Unique File Name.vi ‏35 KB
    Unique File Name_8-5.vi ‏44 KB
    Unique File Name8-6.vi ‏35 KB

  • Can I create a cert with the Java API only?

    I'm building a client/server app that will use SSL and client certs for authenticating the client to the server. I'd like for each user to be able to create a keypair and an associated self-signed cert that they can provide to the server through some other means, to be included in the server's trust store.
    I know how to generate a key pair with an associated self-signed cert via keytool, but I'd prefer to do it directly with the Java APIs. From looking at the Javadocs, I can see how to generate a keypair and how to generate a cert object using an encoded representation of the cert ( e.g. java.security.cert.CertificateFactory.generateCertififcate() ).
    But how can I create this encoded representation of the certificate that I need to provide to generateCertificate()? I could do it with keytool and export the cert to a file, but is there no Java API that can accomplish the same thing?
    I want to avoid having the user use keytool. Perhaps I can execute the appropriate keytool command from the java code, using Runtime.exec(), but again a pure java API approach would be better. Is there a way to do this all with Java? If not, is executing keytool via Runtime.exec() the best approach?

    There is no solution available with the JDK. It's rather deficient wrt certificate management, as java.security.cert.CertificateFactory is a factory that only deals in re-treads. That is, it doesn't really create certs. Rather it converts a DER encoded byte stream into a Java Certificate object.
    I found two ways to create a certificate from scratch. The first one is an all Java implementation of what keytool does. The second is to use Runtime.exec(), which you don't want to do.
    1. Use BouncyCastle, a free open source cryptography library that you can find here: http://www.bouncycastle.org/ There are examples in the documentation that show you how to do just about anything you want to do. I chose not to use it, because my need was satisfied with a lighter approach, and I didn't want to add a dependency unnecessarily. Also Bouncy Castle requires you to use a distinct version with each version of the JDK. So if I wanted my app to work with JDK 1.4 or later, I would have to actually create three different versions, each bundled with the version of BouncyCastle that matches the version of the target JDK.
    2. I created my cert by using Runtime.exec() to invoke the keytool program, which you say you don't want to do. This seemed like a hack to me, so I tried to avoid it; but actually I think it was the better choice for me, and I've been happy with how it works. It may have some backward compatibility issues. I tested it on Windows XP and Mac 10.4.9 with JDK 1.6. Some keytool arguments changed with JDK versions, but I think they maintained backward compatibility. I haven't checked it, and I don't know if I'm using the later or earlier version of the keytool arguments.
    Here's my code.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.security.KeyStore;
    import java.security.KeyStoreException;
    import java.security.NoSuchAlgorithmException;
    import java.security.cert.CertificateException;
    import javax.security.auth.x500.X500Principal;
    import javax.swing.JOptionPane;
    public class CreateCertDemo {
         private static void createKey() throws IOException,
          KeyStoreException, NoSuchAlgorithmException, CertificateException{
         X500Principal principal;
         String storeName = ".keystore";
         String alias = "keyAlias";
         principal = PrincipalInfo.getInstance().getPrincipal();
         String validity = "10000";
         String[] cmd = new String[]{ "keytool", "-genKey", "-alias", alias, "-keyalg", "RSA",
            "-sigalg", "SHA256WithRSA", "-dname", principal.getName(), "-validity",
            validity, "-keypass", "keyPassword", "-keystore",
            storeName, "-storepass", "storePassword"};
         int result = doExecCommand(cmd);
         if (result != 0){
              String msg = "An error occured while trying to generate\n" +
                                  "the private key. The error code returned by\n" +
                                  "the keytool command was " + result + ".";
              JOptionPane.showMessageDialog(null, msg, "Key Generation Error", JOptionPane.WARNING_MESSAGE);
         KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
         ks.load(new FileInputStream(storeName), "storePassword".toCharArray());
            //return ks from the method if needed
    public static int doExecCommand(String[] cmd) throws IOException{
              Runtime r = Runtime.getRuntime();
              Process p = null;
              p = r.exec(cmd);
              FileOutputStream outFos = null;
              FileOutputStream errFos = null;
              File out = new File("keytool_exe.out");
              out.createNewFile();
              File err = new File("keytool_exe.err");
              err.createNewFile();
              outFos = new FileOutputStream(out);
              errFos = new FileOutputStream(err);
              StreamSink outSink = new StreamSink(p.getInputStream(),"Output", outFos );
              StreamSink errSink = new StreamSink(p.getErrorStream(),"Error", errFos );
              outSink.start();
              errSink.start();
              int exitVal = 0;;
              try {
                   exitVal = p.waitFor();
              } catch (InterruptedException e) {
                   return -100;
              System.out.println (exitVal==0 ?  "certificate created" :
                   "A problem occured during certificate creation");
              outFos.flush();
              outFos.close();
              errFos.flush();
              errFos.close();
              out.delete();
              err.delete();
              return exitVal;
         public static void main (String[] args) throws
              KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException{
              createKey();
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    //Adapted from Mike Daconta's StreamGobbler at
    //http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
    public class StreamSink extends Thread
        InputStream is;
        String type;
        OutputStream os;
        public StreamSink(InputStream is, String type)
            this(is, type, null);
        public StreamSink(InputStream is, String type, OutputStream redirect)
            this.is = is;
            this.type = type;
            this.os = redirect;
        public void run()
            try
                PrintWriter pw = null;
                if (os != null)
                    pw = new PrintWriter(os);
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    if (pw != null)
                        pw.println(line);
                    System.out.println(type + ">" + line);   
                if (pw != null)
                    pw.flush();
            } catch (IOException ioe)
                ioe.printStackTrace(); 
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.security.auth.x500.X500Principal;
    public class PrincipalInfo {
         private static String defInfoString = "CN=Name, O=Organization";
         //make it a singleton.
         private static class PrincipalInfoHolder{
              private static PrincipalInfo instance = new PrincipalInfo();
         public static PrincipalInfo getInstance(){
              return PrincipalInfoHolder.instance;
         private PrincipalInfo(){
         public X500Principal getPrincipal(){
              String fileName = "principal.der";
              File file = new File(fileName);
              if (file.exists()){
                   try {
                        return new X500Principal(new FileInputStream(file));
                   } catch (FileNotFoundException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                        return null;
              }else{
                   return new X500Principal(defInfoString);
         public void savePrincipal(X500Principal p) throws IOException{
              FileOutputStream fos = new FileOutputStream("principal.der");
              fos.write(p.getEncoded());
              fos.close();
    }Message was edited by:
    MidnightJava
    Message was edited by:
    MidnightJava

  • API8532: Internal Error: Language Validation can't create a unique type nam

    When I tried to validate an expression for a field in EXPRESSION operator in OWB, I got the error message:
    java.lang.Exception: ValidationError?
    java.lang.Exception: API8532: Internal Error: Language Validation can't create a unique type name when attempting to deploy a validation package.
    Can you please help me out in this matter?

    Good morning guys,
    Here's what I found at Metalink for the aforementioned patch:
    ====================================================
    This patchset is obsolete in this platform and language. Please see the reason stated below. Please contact Oracle Support for replacement patch.
    Reason for Obsolescence
    This patch was originally hosted as Generic. It will be obsoleted and rehosted as 2 different patches Patch ID 3455473 is for Windows Patch ID 3455474 is for Solaris 32 bit
    Patchsets known to include or supersede Patchset 3443542
    No information available from the patch repository.
    ====================================================
    Hence my remark about the no-availability for AIX.
    Anyway, do I really need to patch to 9.2.0.4 if I'm at 9.2.0.2.8 and the API8532-error still occurs?
    Thanks.
    Cheers, Patrick
    PS
    Trying to follow the links to the new patches is to no avail, I get:
    "Error
    No search executed. Please provide a valid patch number.
    Trying a generic search for my platform and my version is a tad difficult, as far as I know my OWB-install was not a part of a 9iAS or 9iDS suite, so which one to choose... ?

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • Java.sql.SQLException: can't create statement from closed connection

    java.sql.SQLException: can't create statement from closed connection.
    at com.caucho.sql.QPooledConnectionImpl.prepareStatement(QPooledConnecti onImpl.java:411)
    I am getting this error with my JSP's, i am running on Resin on Win2k, and MySql as backend.
    Has anyone else also faced this issue ?
    Looking for someone to help me to solve this issue.
    rc

    Looking for someone to help me to solve this issue.Maybe you are closing the connections. You might want to verify that you are not doing that. Or if you are that that is the correct way to return the connection to the pool.
    Or you could have stale connections. Some databases will time out connections if the connection is no used in a while. (This is a good thing.) But this means connection pools must do something with connections that are not used for a while. The pools usually have a configuration option(s) which allows you to set up a keep alive message which keeps the database from closing the connection.

  • What type of files can we create in Java?

    In general what type of files can we create in Java?
    For example, we can create .dat and .txt files as follows:
    DataOutputStream ostream;
    ostream = new DataOutputStream(new FileOutputStream("myfile1.dat"));
    or
    ostream = new DataOutputStream(new FileOutputStream("myfile2.txt"));
    Can we create ASCII?
    Thank you in advance for your answers.

    In general what type of files can we create in Java?You know that a file is nothing more than a series of ones and zeros, with eight of those bundled together as something called a byte. What they actually mean is what you make them to mean. Short: you can write and read any file type you like, but doing that semantically correct it is your responsibility.

  • Can we create installer for  Java projects ?

    when we create any desktop application using swing. Can we create installer for that application that will include all the files, which is required to run that application including data base. Data base is Mysql and in some case it might be MS Access.
    We can create the jar files for this and deploy. But other then this ...
    Is it possible to create ?? If anybody have idea then plz give me steps how to do this ??
    welcome in advance for reply...

    MukeshSinghRathaur wrote:
    when we create any desktop application using swing. Use [Java Web Start|http://www.java.com/en/download/faq/java_webstart.xml] *(<- link)*
    ..If anybody have idea then plz give me steps how to do this ??Please take the effort to type all 6 letter of the word 'please'. Also - one '?' indicates a question, whereas 2 or more often indicates a bozo.
    Do some research, ask a specific question. These forums are not designed as a 'help-desk' where people will hold your hand and tutor you as to how to do things.

  • Can I create Oracle Database using Java ???

    HI ...
    Can I create a Database using Java... ? If yes can any one tell me how ? I mean provide some codeing help... ???

    If you mean a table yes, since the create table statement is exactly that, an SQL statement, if you mean an SID then I would have to say (AFAIK) no.

  • Can't create Java VM [Code :- 3 ] with JNI_CreateJavaVM()

    hello all,
    I am trying to create an inctance of JVM from C/CPP ( iam using VC++ editor) on windows. My code to create JVM is :
    res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
    as a reasult of this call, -3 is returned to res.
    please help me to create a JVM and/or call a java class from C/CPP
    Thanks in advance,
    Soujanya.R

    I tried to run it this way :-
    #include <jni.h>
    #include <windows.h>
    #define JNI_EVERSION (-3) /* JNI version error */
    #define PATH_SEPARATOR ';'
    #define USER_CLASSPATH "." /* where Prog.class is */
    void main() {
              JNIEnv *env;
              JavaVM jvm = (JavaVM )0;
              jint res;
              jclass cls;
              jmethodID mid;
              jstring jstr;
              jobjectArray args;
              HINSTANCE hVM = NULL;
              JavaVMInitArgs vm_args;
              JavaVMOption options[4];
              printf("\noptions");
              options[1].optionString = "-Djava.class.path=C:/j2sdk1.4.1_07/jre/lib/rt.jar;E:/test/c/Debug/"; /* user classes */
              options[2].optionString = "-Djava.library.path=lib"; /* set native library path */
              options[0].optionString = "-Djava.compiler=NONE";
              //options[1].optionString = "-Djava.class.path=c:\\My Folder"; /* user classes */
              //options[2].optionString = "-Djava.library.path=C:\\j2sdk1.4.2_04\\include";
              options[3].optionString = "-verbose:jni";
              printf("\nversion info");
              vm_args.version = JNI_VERSION_1_2;
              vm_args.options = options;
              vm_args.nOptions = 4;
              vm_args.ignoreUnrecognized = TRUE;
              printf("\ncreate");
              hVM = LoadLibrary("C:/j2sdk1.4.1_07/jre/bin/client/jvm.dll");
              if (hVM == NULL)
                   printf("hVM is null ");
              res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
              if (res < 0) {
                   fprintf(stderr, "Can't create Java VM \n",res);
                   exit(1);
              cls = env->FindClass("HelloWorld");
              //cls = env.FindClass(env,"helloWorldClass");
              if (cls == 0) {
                   fprintf(stderr, "Can't find Prog class\n");
                   exit(1);
              mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
              if (mid == 0) {
                   fprintf(stderr, "Can't find Prog.main\n");
                   exit(1);
              jstr = env->NewStringUTF(" from C!");
              if (jstr == 0) {
                   fprintf(stderr, "Out of memory\n");
                   exit(1);
              args = env->NewObjectArray(1, (*env).FindClass("java/lang/String"), jstr);
              if (args == 0) {
                   fprintf(stderr, "Out of memory\n");
                   exit(1);
              env->CallStaticVoidMethod(cls, mid, args);
              jvm->DestroyJavaVM();
    I could run the program.
    You need to have the C:\j2sdk1.4.1_07\lib\jvm.lib entries in Project->Settings->Link Tab
    When you open the Settings dialog box you will see Win32Debug in the
    drop down . You need to provide the entries for that page .
    Then change the drop down to Win32 Release and make an entry similarly there too.
    You should be able to run your code.
    Vishal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I can't create filename "AUX"

    Hi,
    Any one tell me that I can't create a file name "AUX" Why its so.

    phdk wrote:
    read this: [http://en.wikipedia.org/wiki/Filename]
    Wikipedia is awesome!

Maybe you are looking for

  • Urgent: regarding sub total button in alv report

    hi, i had made dis report and it is is fine till now,but now i want add the sub total field in it ,by making double click on the field sub-total should be displayed in it. here is d code as i had tried the sub - total but when i execute it is giving

  • BlackMagic Intensity Pro Capture Card & (3) 1TB Internal Hard Drives

    Hello, This is my first time using BM Intensity Pro. Prior to tonight all I used was FW400 & iMovie/iDVD. I have now upgraded to Final Cut Studio with a BM Intensity Pro Capture Card and Three 1TB Hard Drives (7200 RPM with 32MB cache) - Striped as a

  • Reading Dynamic Configuration information in side adapter module.

    Hi All, We are writing an adapter module for one of our receiver adapter. On the Sender side we have a file adapter whose adapter specific properties are checked. So the message has the file name in the Dynamic configuration. Now we need to read this

  • Preview won't print some PDF files

    Hi everyone, I know a similar problem has been already discussed but it was not solved. When I print some PDF files from Preview on a Lexmark C524 color laser printer, I get only figures and symbols but no text. If I print the same files on a HP 2100

  • How to Modify Desktop

    I need to add an effect around the cursor to find easier, and I like the idea of stretching or modifying the current image behind the cursor for good visual effect.  I have taken two approaches, a) to draw a opaque window on top of desktop at the cur