How to create a executable file from .java file?

Well usually we would compile and run our program using jdk1.x. Can we create a .exe file so that it will run everytime I open it without compile and run it?
Regards,
Ng

hai,
you can create a batch file,in it define the commands javac and java.so that whenever u are running the batchfile it is compiled and the program is executed..
it will work..
bye,
j.mouli

Similar Messages

  • How to run perl file from java file..???

    Hi All,
    How to run a perl file from java file.I know that there is one JPL(Java-Perl Library) preprocessor which can be used to do this,but no idea of how to do it..
    Any help is appreciated.
    Thanks in advance.

    viswa07 wrote:
    Ok and any idea regarding JPL..????I don't know it and the first few posts that I found mentioned it using Java 1.1-style JNI calls, which hints at a dead project. And you don't want to use a dead project.

  • How to create package and import from jar file?

    Hi all,
    I am writing a software and I am not sure how to create a package for the classes.
    Say I have two classes in the same directory as follows:
    testA.java
    ==========
    package AB;
    public class testA
    public static void main(String[] args){
         testB myB = new testB();
         System.out.println("A test");
    testB.java
    ===========
    package AB;
    public class testB
    public testB(){
         System.out.println("B constructor");
    both file compile without the package heading;
    both file compile using: javac -classpath .\ *.java
    Question 1:
    I cannot run testA by: java -classpath .\ testA
    I think it is a syntax error. What is the correct one?
    If I run testA by: java testA
    The only output I get is: A test
    But I am expecting: B constructor /n A test
    What went wrong?
    Question 2:
    I need to use APIs of another software. I have downloaded a .jar file (xxx.jar) with all the classes in it. And I have put "import xxx.*;" in my source file. But the compiler complains about the importing. What is the right way to copmile it?
    I have read a couple of tutorials but they don't answer my question.
    (I am using windows2000 and don't have the classpath variable.)
    Hope some one can help.
    Thanks a lot

    Try moving testA out of the package and importing 'AB.*;'
    If you have:
    ./testA.class
    ./AB/testb.class
    Then to execute testA from ./ type: java -cp . testA

  • How to create an ODBC entry from Java

    From Java application, how can I create an ODBC entry in Ms Windows client?

    I know of two ways you could do this. One is very dangerous, but I will describe it here. ODBC DSN's are created using a GUI application from within the Windows Control Panel. The GUI application manages a set of files found in the Windows directory. You can find them if you search for the ODBC. You should find odbc.ini and odbcinst.ini. These are text files, and you can view there structure using notepad. A Java program could open a stream and append whatever information you want to into these two files. The danger is that if you do it wrong, you will corrupt ODBC for all applications, so be very careful with this method.
    The 2nd method, as I described above has been discussed (to death) within this forum. Just spend a little time searching, and I know you will find what you need to implement using that method. This is the method I would recommend using.
    Good Luck,
    Joel

  • Creating .jnlp files from .java files

    Last resort: Ask on the forums. I'm having a lot of trouble creating .jnlp files with only a .java file. For some reason if I do create project, the project does not run correctly, but when I make the file and run the file alone, it works perfectly fine. Most of the tutorials that I have read online ask me to do weird manifest .class stuff (in order to make JAR files, which i have failed to do even after attempting to make one after 3 hours). And still, when it comes to make the .jnlp file, I don't quite understand anything. When putting it on the web, I'm planning not to use php (html is in my mind right now), and I have aborted every single attempt at making the JAR files and whatnot.
    At this point, I'm not asking for anything other than a link to a tutorial that actually works, because all that I have tried (for the JAR files, especially) have been giving me errors. By the way, one really bothersome output that comes up is the "illegal option: j" when I use the Tool for the JAR file, and I have no idea what that means--I google it and find nothing. The .java itself extends JPanel, so it isn't really an applet.
    How to: Run an Applet
    Create an Applet Class by clicking File > New > File > File Type > Java Classes > Applet Class.
    Enter a name and path for the applet and click Finish.
    Build the file by pressing F7.
    Create an Applet HTML file by clicking File > New > File > File Type > Other > HTML Applet.
    Enter a name and path for the applet and click Finish.
    Open the HTML file in JCreator and modify the applet tag to match the name of the applet class.
    Open the Project Settings window and select the HTML file as the Run parameter.
    Click the Run Project button.It isn't really a code, but I tried doing this and the HTML Applet said code = ".class" Again, I don't have a class for the file. And when you do the "File > New > File > File Type > Java Classes > Applet Class," you get the .java file and a folder that says "components, with two classes in it. I was completely befuddled.

    http://forum.java.sun.com/thread.jspa?messageID=9783924

  • How to run .html file from .java file..?

    Hi All,
    I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
    Thanks in advance.

    viswa07 wrote:
    You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
    [This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
    db

  • How to create a inbound IDOC from flat file in Application server

    HI All
    Our requirement is to create the Inbound idocs from a flat file from application server with in R/3
    Could any body please let me know the steps required for this.
    Thanks
    Malli

    1. Read the file using OPEN DATASET and read and fill up the segment info and fill the EDIDC header data
    and then call function
    CALL FUNCTION 'INBOUND_IDOC_PROCESS'
        TABLES
          IDOC_CONTROL       =  i_edidc
          IDOC_DATA          =  i_edid4.

  • Creating exe files from java files

    Hi all.
    I've created a Java GUI file and I want to create an exe file of it, so i can just double click on the icon and opens up..
    Anyway as to how i could do this?
    Hope to hear from anyone. Would be a great help
    Kind Regards,
    Raheal

    http://forum.java.sun.com/thread.jspa?messageID=9783924

  • Unable to execute sh file from java file on the solaris

    hi all
    i have written a java program through which i want to shutdown the weblogic server on the solaris.
    I have written following code
    static Runtime objruntime = null;
    objruntime = Runtime.getRuntime();
    Process objprocess=null;
    String url = "/home/xxx/xxx/xxxx/xxxxx/stopWebLogic.sh";
    try {
                   objprocess = objruntime.exec(url);
                   objprocess.destroy();
                   System.out.println("Server shutdown OK..");
              } catch (Exception e) {
         System.out.println("Error executing Cedera Server shutdown." + e);
    I am able to execute the above code on the linux 7.1 means server get shutdown forcefully.
    But when i am trying to execute above code on solaris, server is not getting shutdown.
    Can anybody please help to solve this problem.
    Thanks in advance
    regards
    andy

    we didn't got what you are trying to say..
    what i want to achieve is...
    we are having one condition check in Startup class if that condition becomes false we have to stop the weblogic from starting up.
    if we execute same command posted previously from shell directly its' working fine.
    we are using "csh" shell. we have also tried to execute the command as follows - " csh /home/xxxx/xxx/xxx/xxxxx/stopWebLogic.sh"
    but no achievement.
    it seems that "objruntime.exec(url);" is not able to invoke the shell script "stopWebLogic.sh". We have also checked the execute permission for the same.
    Neither we are getting any error nor any message.
    can u please give us some guide lines on how to achieve this.

  • How to create a Help page from a file

    Hello,
    I have a new APEX application and someone made a nice help document using MS Word.
    How could I inlcude that file into a Help Page, or some ideas on how this could be seen by the users?
    Thanks

    Hi,
    Apex has a facility whereby you can create a context sensitive help page facility.
    see http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21674/bldapp_hlp.htm#CHDCDBFB
    With your help document, save the section relevant to a page as a separate document and save it as a filtered web page. Edit this document in a plain text editor and cut and paste this into the help text for the page.
    When you select help from the navigation bar, then this help text will be shown for the current page. To make it even fancier, you can define the link for the navigation bar to show the help page as a popup, so that you don't loose the current context in the application.
    Regards
    Andre

  • How to make exe files from java files

    Ohhh, so you thought you were going to answer that question? Well I already know the answer, i.e. all the tricks with the jar files or the programs which convert java programs into executable programs.
    The reason why I asked this question was to start a discussion concerning question which are frequently asked in the forums. Wouldn�t it be nice to have like statistics over the most faq here, and of course one or several pages with the answers to these questions? This would solve 2 problems:
    1) The person who wants to ask the question can find the answer and the solution quickly.
    2) The forums would not be packed with the same questions all the time.
    I mean, you must admit that the questions regarding �exe files� are asked a lot of times.
    Happy coding to ya all!
    /TM

    Yeah thats my point! these questions should be moved
    to a special page, where the answer to theam areDid you the whole message? I said there are FAQs.

  • How to create a link (path) from a file.

    Hello,
    I'm sending an email out and would like to tell the team where a graphic file (illustrator file) is located. I've seen in other emails where it comes in a form of a link (i.e.,  file://localhost/Volumes/creative/Active/VISUAL/.....20ENDCAP%20-%20JULY-AUG%2012.ai); click on this link and takes one directly to the graphic file. I've tried control clicking on the file (MAC platform) and didn't see anything remote indicating a link.
    Does anyone has insight to this question?
    Thanks!
    Suta

    1. Read the file using OPEN DATASET and read and fill up the segment info and fill the EDIDC header data
    and then call function
    CALL FUNCTION 'INBOUND_IDOC_PROCESS'
        TABLES
          IDOC_CONTROL       =  i_edidc
          IDOC_DATA          =  i_edid4.

  • How can i call forpro prg file from java

    Hai friends,
    I have a doubt,clear it.
    how can i call forpro prg file from java file
    by,
    N.Vijay

    Thanks to your reply,
    I have some print statements in my foxpro program file.
    Then i like to invoke that foxpro file from my java file
    This want i want..,
    by,
    N.Vijay

  • How to create and execute PL/SQL program or Procedure from Java (JDBC)

    hi all,
    user will enter the Pl/Sql program from User-Interface. that program has to be create in DB and execute that.
    due to some confusions, how to execute this from Java, i (user) entered the same logic through a Procedure.
    my Java code is
    Statement st = con.createStatement();
    Statement.execute(procedure_query); // procedure name is myPro
    CallableStatement cs = con.prepareCall("{call myPro}");
    (as given in SUN docs - http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html)
    but its not creating the procedure.
    and i tried to run a procedure (which is already created) with CallableStatement, and this is also not working.
    how to get this.
    thanks and regards
    pavan

    Hi,
    SInce the PL/SQL block is keyed in dynamically, you probably want to use the anonymous PL/SQL syntax for invoking it:
    // begin ? := func (?, ?); end; -- a result is returned to a variable
    CallableStatement cstmt3 =
    conn.prepareCall(“begin ? := func3(?, ?); end;”);
    // begin proc(?, ?); end; -- Does not return a result
    CallableStatement cstmt4 =
    Conn.prepareCall(“begin proc4(?, ?); end;”);
    SQLJ covered in chapter 10, 11, and 12 of my book furnish a more versatile dynamic SQl or PL/SQL mechanisms.
    Kuassi
    - blog http://db360.blogspot.com/
    - book http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html

  • How I can create a XML file from java Aplication

    How I can create a XML file from java Aplication
    whith have a the following structure
    <users>
    <user>
    <login>anyName</login>     
    <password>xxxx</password>
    </user>
    </users>
    the password label must be encripted
    accept any suggestion

    Let us assume you have all the data from the jsp form in an java bean object..
    Now you want a xml file. This can be acheived in 2 ways
    1. Write it into a file using java.io classes. Say you have a class with name
    write("<name>"+obj.getName+</name>);
    bingo you have a flat file with the xml
    2. Use data binding to do the trick
    will recommend JiBx and Castor for the 2nd option
    Regards,
    Rajagopal

Maybe you are looking for

  • Calling user function in where clause

    Hi I need to use a sql query in following format. SELECT * from emp where emp_name = getEmpName (p_emp_id => '123'); getEmpName is a private function within the package which will return a emp_name for a given emp_id. But it is giving error that miss

  • Hyperlink to a webpage in a media widget caption

    Is there a way to make a link to an external website in caption text? I inserted a media widget and a video clip. Below the clip is the text caption of the talking head speaker's name and a line of text describing what he is saying. I'm trying to cre

  • Lumia 1020; app update error 80073cf6 after cyan ...

    I updated my Lumia 1020 to the Nokia Cyan firmware today. Most of the app updates went fine but now some updates from the store are stuck with the error code 80073cf6. I tried restarting the phone but that does not help. Any ideas?

  • Re: Satellite L350-170 - WiFi stops and starts

    Hello, I have the Toshiba Satellite L350-170 and it's great. I am running Vista 32-bit and I have had it from Christmas '08. For a while now, the WiFi will just stop (if I use webcam on msn or something) as if it's just overloaded, then I have to wai

  • OS 10.0.10.90 one day in

    As the topic header states downloaded 10,0.10.90 today, (UK) all lot of issues seem to have been addressed. It appears battery life has been improved, not sure how but after a heavy day Im stll 50% full or is that , empty? Rotation in keyboard mode a