這個源代碼比較難拿,我說一下就好啦
比如現在我們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);
}
}
}
比如現在我們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);
}
}
}
解决方案 »
- 在JPanel上画图显示不出来 求教!!!
- StaticDemo问题,程序有点看不懂
- jar运行时出现错误:Exception in thread "main" java.lang.NoClassDefFoundError
- 求教如何把迭代器中的循环的(String)数据取出存入到Strin数组中
- 江湖小问题,在java中的事务处理
- servlet中根据参数判断调用哪个方法的问题
- 高手救命啊(图形的Java应用程序无法启动,控制台程序可以)
- ----ArrayList的问题-----
- 救急!!!!!!!!!!!!!!!!!!
- 百分求教!简单问题
- 寻电子版图书
- 报cannot resolve symbol怎么处理
比如把JAVA程序編譯成exe文件
然后怎么樣可以給這個文件一個自定義的JRE呢
就是修改過的JRE包,而不是要安裝一個請教大俠,謝謝