I am doing this to compile my Java application

Hi, I am doing this when I click on a button in my application to compile my application in an editor. But my application gets hanged when I do this. Could any one correct me where I am wrong.
Thanks
File file;
JTextPane textForJIF;
JTextArea compileArea;
          if(ae.getSource().equals(compileJavaB) || ae.getSource() == javac)
                    try{
               if ( textForJIF.getText().length() > 0 )
                    //File file = frame.getFile();
                    String fileName1 = file.getName();
                    String pathName = file.getPath(),fileName = file.getName();
                    if ( !fileName.endsWith(".java") )
                         return;
                    //String dirPath = file.getParent();
                    String currentDir = file.getParent();
               Runtime rt = Runtime.getRuntime();
               startTime = System.currentTimeMillis();
          Process p = rt.exec( command, null, new File( currentDir ) );
          BufferedReader reader1 = new BufferedReader(new InputStreamReader(p.getInputStream()));
               BufferedReader reader2 = new BufferedReader(new InputStreamReader(p.getErrorStream()));
               endTime = System.currentTimeMillis() - startTime;
               long lg = endTime/1000;
               String time = "Time taken: " + lg + "." + (endTime-lg*1000) + " seconds.";
               String result = "Java Compiler"+ p + "Time taken:"+time;
               String message = "Result";
               //for(int i=0;i<10;i++)
                    String message1 = reader1.readLine();
                    System.out.println("message1:"+message1);
                    String messageIn = reader2.readLine();
                    System.out.println("messageIn:"+messageIn);
               //     if(messageIn == null)     break;
                    message = messageIn+"\n"+message;
               System.out.println("message is:"+message);
               compileArea.setText(message);
               //compileArea.append(result);
               p.destroy();
               }catch(Exception ex) { System.out.println(ex); }

What is the error you are getting?

Similar Messages

  • What does this message mean: "power pc applications are no longer supported"?

    What does this message mean: you can not start because power pc applications are no longer supported?

    Here is a post that I assembled for another who needed to continue to run his PowerPC applications in Lion/Mt. Lion:
    Unfortunately you got caught up in the minor miracle of Rosetta.  Originally licensed by Apple when it migrated from the PowerPC CPU platform that it had used from the mid-1990's until the Intel CPU platform in 2006, Rosetta allowed Mac users to continue to use their library of PPC software transparently in emulation.
    However, Apple's license to continue to use this technology expired with new releases of OS X commencing with Lion (and now Mountain Lion).  While educational efforts have been made over the last 6 years, the fact is that Rosetta was SO successful that many users were caught unaware UNTIL they upgraded to Lion or Mountain Lion.
    Workarounds:
    1. If your Mac will support it, restore OS X Snow Leopard;
    2.  If your Mac will support it, partition your hard drive or add an external hard drive and install Snow Leopard into it and use the "dual-boot" method to choose between your PowerPC software or Lion/Mt. Lion;
    3.  Upgrade your software to Intel compatible versions, or find alternative software that will open your data files;
    3.  Install Snow Leopard (with Rosetta) into Parallels:
                                  [click on image to enlarge]
    Full Snow Leopard installation instructions here:
    http://forums.macrumors.com/showthread.php?t=1365439
    NOTE: STEP ONE of the instructions must currently be completed on a Snow Leopard or Lion Mac and the resulting modified Snow Leopard.cdr install file can then be moved over to your Mountain Lion Mac for completion of the remaining steps.
    NOTE 2:  Computer games with complex, 3D or fast motion graphics make not work well or at all in virtualization.

  • How to compile my java application for Personal Java??

    i write a simple program and want to run it in PJEE.
    program is:
    import java.awt.*;
    public class TestApp {
    public static void main(String[] args) {
    Frame f = new Frame();
    f.pack();
    f.setSize(300,300);
    f.show();
    and i compiled it using JDK1.4
    javac TestApp.javathen i want to test it by using pjava
    pjava TestAppbut i got a error message:
    Error loading class TestApp: Bad major version numberplease tell me what it is mean and how i can debug it, thanks.

    hi, all
    i have resolved my question by myself.
    because:
    |-> personal java
    |
    jdk1.1 -> jdk1.2 -> jdk1.4
    so, i must compile the java file by using jdk1.1.x
    :)

  • When trying to launch a Java preferences get this message:  Cannot launch Java application A static initializer of the main class threw an exception: java.lang.NullPointerException"

    I have an IMac 10.5.8 and I am having problems with Java. I have tried todownload Java for Mac OS X 10.5 Update 4 and it looks as if it is doingsuccessfully, but I cannot see where it has put it and get this message when trying to launch Java preferences:
    Cannotlaunch Java application
    A static initializer of the main class threw an exception:java.lang.NullPointerException"
    Couldyou please help?

    Hmm, only way I know would be a relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
    http://docs.info.apple.com/article.html?artnum=107120
    Just be sure to select Preserve Users & Settings.

  • 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,

  • Now that Logic 8 is out, does this mark a steadily growing application?

    I don't know how Apple treats their other Pro Apps like final cut, but it seems like FCP, Shake, etc.. get pretty regular updating. Can we expect maybe even bi-annual improvements now that the ship has left dock?
    I think that users who are excited to see this new direction in the area of cleanup and audio editing should continuously be on the march for the "missing links" of logic in the Pro Audio area. I understand that from a marketing stance logic is a mass marketed product, more so than Pro Tools. But it is so close to being the baddest DAW out there, I sure hope they will close the gap!
    Its like politics.. Our candidate just won the election but now we gotta stay on him to keep him on track!

    I don't know how Apple treats their other Pro Apps like final cut, but it seems like FCP, Shake, etc.. get pretty regular updating. Can we expect maybe even bi-annual improvements now that the ship has left dock?
    I think that users who are excited to see this new direction in the area of cleanup and audio editing should continuously be on the march for the "missing links" of logic in the Pro Audio area. I understand that from a marketing stance logic is a mass marketed product, more so than Pro Tools. But it is so close to being the baddest DAW out there, I sure hope they will close the gap!
    Its like politics.. Our candidate just won the election but now we gotta stay on him to keep him on track!

  • Does ACR1281U-C1 cards support Java Card?

    I just got my self an ACS Card reader for ACR1281U-C1 cards, but I don't know how to install my cap file onto the cards. I've read the documentations, but failed to find any hints. Does this cards even support Java Card?

    andirady wrote:
    The cards came with the reader.Then my bet these are either Mifare 1K (if they have no contacts), or one of these
    http://www.acs.com.hk/index.php?pid=products&id=1
    and AFAIK, none are Java Card cards.
    What about
    - telling if the cards have contacts or not;
    - posting the ATR that the reader gives for the card, in contact and contactless mode as applicable?
    The later could be interpreted according to the info in the spec, circa page 33.
    http://www.acs.com.hk/drivers/eng/API-ACR1281U-C1-1.03.pdf

  • Reverse-Engineer Java Class Files ---- Launch Java Application From Icon

    hi,
    is there a way to prevent java class files from being interpreted back into java source files (jad.exe does exactly that) ?
    i have a batch file to compile my java application and another to run the application. the application is run by invoking the batch file from dos window.
    i'd like to be able to double-click on some icon to launch the application.
    how do i accomplish this?
    thank you.

    s there a way to prevent java class
    files from being interpreted back into
    java source files (jad.exe does exactly that) ?There are two ways to prevent that:
    1. Use an obfuscator. Look at this page for
    explanation of what is that, and then search google
    "java obfuscator" for products.
    http://www.devx.com/tips/Tip/13580
    2. Compile your application to native code (google
    for "excelsior jet" or "gcj"). Look at this page for
    more details:
    http://www.excelsior-usa.com/jetprotection.html
    i'd like to be able to double-click on some
    icon to launch the application.
    how do i accomplish this?Do you want to do that on your computer only, or you
    need a solution to make the clickable icon on
    computers of your end-users?
    Denis.thanks to all,
    i'll see suggest sites for more details on obfuscator.
    I'd like to have the application doulbe-clickable on end-users' computers.

  • APEX application integration into Java application

    Hello,
    I'm working on a new APEX application and I would like to integrate that application into an existing Java application.
    The integration should be invisible for the end-users. Our application will have the same look and feel as the Java application.
    The existing menu of the Java app will be extended with a new link. This link will then call our application.
    Visually I was thinking about using an Iframe to display the content of the APEX application inside the Java generated xHTML.
    This is however not the biggest issue.
    We are working in a secure context and we thus need to make sure that our APEX application doesn't create a backdoor on the
    security mechanism provided by the Java app.
    Some options have come to mind, but the one that look best is this:
    We keep the java application as the single point of entry for our end-users and make sure that the apex application is "hidden".
    We could do this by means of some re-routing code in the java application so that the incomming requests there are send to the correct server (java or apex).
    Then we will need to capture the response of the APEX application and place it inside the Java generated xHTML. The combined content is then send to the client.
    Or we could place a reverse proxy server that does this for us.
    The goal is thus that we can rely on the existing java application to cover the security and the navigation structure.
    Any ideas on this ?
    How-to's or other options ?
    thanks & regards
    Karel

    In a project I am currently working on we do it using iframes and passsing parameters over a http link.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Creating an xdp file from flex/java application

    Hi,
    I have an application in Flex 4  and As 3.When I click a button in flex application I have to generate a file in java with
    extension xdp.When I try this locally(Run as java application) the file is generating  correctly.When i compile the applic
    ation and try it, the file is not writing correctly.Do someone have any idea about creating an xdp file from flex application?
    i am using blazeds to connect java and flex4.When i opens the file in notepad the file is writing correctly.There is only problem in openig an xdp file...
    please help me.

    specifically:
    Runtime.getRuntime().exec("filename.exe")

  • Consume Enterprise Services in Java Application

    Hey guys,
    I'm very new in this field, maybe you can help me how to start....
    I want to call Enterprise Services (asynchronous, provided by SAP) from an external java application. Therefore I want to configure a integration scenario between two business systems: java application (consumer) and sap application system (service provider). Maybe you can help me to answer the following questions.
    1) What kind of adapter I have to use in communication channels?
    2) Have I to define outbound/inbound interfaces for Communication Component "sender" (business system: java application)?
    2) How does the communication between the java application and IS work? What kind of API I have to use - some kind of advanced adapter engine ... JCO, JCA ???
    Is there any demo scenario from sap? Please help me to start
    Kind regards,
    Christian

    Hello,
    problem is you are using wsimport on web-service which uses RPC/encoding. Wsimport use JAX-WS so it is not able read it.
    You should wscompile.bat instead it.
    Here is example :
    wscompile.bat -gen:client -d build/classes -s src -keep config.xml
    (-gen:client -says to generate classes for client
    -d - directory where to store classes
    -s - directory where to store sources
    -keep - to keep source file
    xml file
    Where config.xml looks like
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration
    xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location=
    "http://something/yourws?wsdl"
    packageName="org.your.package.client"/>
    </configuration>
    I hope it will help.
    best regards

  • Control C picked up by background java application

    On Unix platform, the super user starts a stand alone Java application using "nohup java ... &" and run this command in the background.
    Reuse the same Unix session, vi command or "tail -f" any file, and stop the vi or tail with control-C. However control-C is picked up not just by the vi or tail, but also by the java application. This causes the background java application to stop and exit.
    I can reproduce this consistently. JDK version hotspot 1.3.1_01. Solaris 8 SPARC.
    Thanks,
    Michelle

    nohup makes ingoring the signal SIGHUP ("hangup").
    Crtl-C however raises a SIGINT.So...
    1. You open a console window.
    2. You start a nohup java app
    3. You run tail on the log (same window.)
    4. You do control-C
    It terminates both the tail and the java app?

  • Painting jpeg in java application: non-static method ... static context

    Hi!
    I simply want to show a jpeg within a java application. Showing the jpeg in an applet is no problem (see code below). But I have difficulties to translate this code to a java application. No matter what I try to load the jpeg, I end up with the following error:
    non-static method createImage() cannot be referenced from a static context
    How can I surround it? Thanx in advance for your help!
    Working applet
    import java.applet.*;
    import java.awt.*;
    public class shJpAp extends javax.swing.JApplet {
    Image pic;
    /** Creates a new instance of shJpAp */
    public shJpAp() {
    public void init() {
    pic=getImage(getCodeBase(), "lemmer.jpg");
    prepareImage(pic,this);
    public void paint (Graphics g) {
    g.drawImage(pic,0,0,this);
    Application
    import java.awt.*;
    public class shJp extends javax.swing.JFrame {
    Image pic;
    /** Creates new form shJp */
    public shJp() {
    initComponents();
    //pic = java.awt.Toolkit.getImage("lemmer.jpg");
    ---> pic = java.awt.Toolkit.createImage("lemmer.jpg");
    ---> prepareImage(pic, this);
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new shJp().show();
    // Variables declaration - do not modify
    // End of variables declaration
    public void paint( Graphics g) {
    g.drawImage(pic, 0,0,this);
    }

    Hi,
    just want to add a solution I found in some textbook (see code below). I hate finding every possible question in the internet, but seldom fitting answers.....
    But again, one little thing pushed me close to my first heart attack: The code below works well when executed by foot (...java showPic...). In the NetBeans 3.6 the frame refuses to show the pic!
    I am looking for an appropiate forum - but if anyone of you can help, it would be very nice ;-)
    import java.awt.*;
    import java.awt.event.*;
    public class showPic extends Frame {
    Image pic;
    public showPic() {
    addWindowListener( new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    pic = getToolkit().getImage("lemmer.jpg");
    setSize(200,100);
    setVisible(true);
    public void paint(Graphics g) {
    if (pic != null) {
    g.drawImage(pic,60,20,this);
    public static void main( String[] args ) {
    new showPic();
    }

  • Https request in my JAVA application ?

    In order to retrieve the real time flow from my broker in my JAVA application I need to do a https request.
    When using a web browser a window to enter username and password shows up as a result of a request to : https://clients.dubus.fr/clients/nego/crtsdm.exe?code=tnu&origine=FR
    What I would like is to code/simulate this behavior in my JAVA application.
    I thought that JSSE but I can not even find JAVA examples when 'username' and 'password is used'.
    As you see, I am a little bit lost
    Thanks in advance for your help.

    That type of authentication has nothing to do with the HTTPS stuff. It's a standard client-server authentication. The initial request will get a response from the server which includes headers which tell the client it needs to give login information. The browser prompts the user, and uses that in another request to the same source with the user ID info included in the request headers.
    Check out this page for some details:
    http://www.javaworld.com/javaworld/javatips/jw-javatip47.html

  • Windows xp runs java application but does not compile it - urgent please

    Hi
    My new PC(portable) does not compile my java progran:
    'javac' is not recognized as an internal or external command, operatable program or batch file.
    If you have any suggestion, please let me know!
    Aria

    Thanks anyhow;
    The following information is sent to beginners site.
    I have talked to british, belgian and others regarding this problem. They said it is very expensive and we laughed.
    Hi,
    Windows XP runs java application but does not compile it. I get following message:
    'javac' is not recognized as an internal or external command, operatable program or batch file.
    MS-DOS does not exists but a command line edits autoexec.nt having allinformation regarding installed jdk5. I run my java applicat
    ion from here. But no compilation.
    Environment variables has following information.
    JAVA_HOME C:\jdk5.0
    CLASSPATH C:\jdk5.0\myPrograms
    path %JAVA_HOME%bin
    All information in autoexec.nt exists as windows 98 and I run it from command line.
    Would you please tell me what is wrong?
    Thanks
    Aria

Maybe you are looking for