這個源代碼比較難拿,我說一下就好啦
比如現在我們ERP系統是用PB做的而全球數據數據整合用的是JAVA
現在有一個小系統是JAVA寫起來的
原來一直使用批處理來啟動, 同時把JRE整合在一起
我把rt.jar等相關的東東精減了一下,只有几M而現在要在ERP系統中通過PB來調動JAVA程序
就用RUN來跑,現在是用RUN '.\jre\bin\javaw -classpath "jar path...." package.app'
然后通過返回值判斷狀態,但這時候PB得到的是javaw給回的值
而javaw會馬上就把值給回去,如果JRE沒有問題則一定是1其實app程序還沒有跑完
如此在PB系統中給提示信息就不好給以上是問題發生原因;所以請教, 在這種情況下如何得到app的運行狀態呢
app程序很簡單,倒可以拿出來的::package apply;import java.awt.*;
import java.awt.event.*;
import javax.swing.*;import org.fs.kit.mail.*;/**
 * <p>Title: 發送數據</p>
 * <p>Description: 只是為了不顯示DOS窗戶而寫</p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: </p>
 * @author 
 * @version 1.0
 */public class Send extends JFrame {
  public static String iniFile = "";
  private JButton confirm;
  private JLabel msgLbl;  public Send(String iniFile) {
    super("資料發送提示信息");    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    // JLabel constructor with a string argument
    msgLbl = new JLabel("資料正在發送中...");
    msgLbl = new JLabel();
    msgLbl.setToolTipText("發送提示信息");
    c.add(msgLbl);    // create button
    confirm = new JButton("確定");
    c.add(confirm);    ButtonHandler handler = new ButtonHandler();
    confirm.addActionListener(handler);    setSize(280,100);
    Definition def     = new Definition(iniFile);
    ApplySend  as      = new ApplySend(def);
    if(as.sendData()) {
      msgLbl.setText("發送資料成功");
      show();
    }
    else{
      msgLbl.setText("沒有資料需要傳送");
      show();
    }
  }  public static void main(String args[]) {
    String iniFile = ".\\apply.ini";
    Send ss = new Send(iniFile);
    ss.addWindowListener(
        new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        System.exit(0);
      }
    }
    );
  }  // inner class for button event handling
  private class ButtonHandler implements ActionListener {
    public void actionPerformed (ActionEvent e) {
      System.exit(0);
    }
  }
}