0

我尝试使用 Jwrapper 从 JDeveloper 创建的 jar 文件中创建 exe。构建目录中的 ezDBA-windows32-offline 不起作用。它只显示徽标,然后挂起。

谁能告诉我出了什么问题?

运行 JWrapper 的批处理文件: cd C:\JWrapper "C:\Program Files (x86)\Java\jre6\bin\java" -Xmx512m -jar jwrapper-00031607960.jar ezDBA\jwrapper-ezDBA.xml

从示例修改的 JWrapper xml 文件:

<?xml version="1.0"?>
-<JWrapper>
<!-- The name of the app bundle -->
<BundleName>ezDBA</BundleName>
<!-- The specification for one app within the bundle -->
-<App>
<Name>ezDBA</Name>
<LogoPNG>ezDBA/logo.png</LogoPNG>
<MainClass>ezDBA.ezDBA</MainClass>
<Param>one</Param>
<Param>two</Param>
</App>
<SupportedLanguages>en</SupportedLanguages>
<!-- App is a per-user app, it won't elevate and install for all users and the shared config    folder will be per-user -->
<!-- Splash and Logo -->
<SplashPNG>ezDBA/splash.png</SplashPNG>
<BundleLogoPNG>ezDBA/logo.png</BundleLogoPNG>
<!-- JVM options (e.g. extra memory) -->
-<JvmOptions>
<JvmOption>-Xmx556m</JvmOption>
</JvmOptions>
<!-- The JREs JWrapper should use for Windows, Linux32, Linux64... -->
<Windows32JRE>JRE-1.7/win32/jre1.7.0_05</Windows32JRE>
<Windows64JRE>JRE-1.7/win32/jre1.7.0_05</Windows64JRE>
<Linux32JRE>JRE-1.7/linux/jre1.7.0_13</Linux32JRE>
<Linux64JRE>JRE-1.7/linuxx64/jre1.7.0_13</Linux64JRE>
<Mac64JRE>JRE-1.7/macos64/jre1.7.0_45.jre</Mac64JRE>

ezDBA/ezDBA.jar

从 JDeveloper 生成的应用程序有两个文件,可以使用 ezDBA.jar 正常运行

ezDBA.java:

import java.awt.Dimension; 
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class ezDBA_Frame extends JFrame {
    private JLabel jLabel1 = new JLabel();

    public ezDBA_Frame() {
        try {
            jbInit();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.getContentPane().setLayout( null );
        this.setSize( new Dimension(400, 300) );
        jLabel1.setText("This Is A Jwrapper Test");
        jLabel1.setBounds(new Rectangle(115, 90, 135, 30));
        this.getContentPane().add(jLabel1, null);
    }
}

以及ezDBA_Frame.java:

package ezdba;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.UIManager;

public class ezDBA {

    public ezDBA() {
        JFrame frame = new ezDBA_Frame();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }
        frame.setLocation( ( screenSize.width - frameSize.width ) / 2, ( screenSize.height - frameSize.height ) / 2 );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }
        new ezDBA();
    }
}
4

2 回答 2

0

假设您有正确的标签来将您的应用程序 JAR 添加到 JWrapper 构建中,我会说也许您的包 ezDBA 在 JWrapper XML 中大写,但在您的源代码中没有?

所以 JWrapper 正在尝试启动 ezDBA.ezDBA 但您应该将其配置为启动 ezdba.ezDBA?

于 2014-12-16T19:23:57.163 回答
0

当您的应用程序运行时,您是否在日志中看到任何内容:

http://www.jwrapper.com/guide-where-your-app-is-installed-and-logs.html

运行顺序为:

Wrapper-... GenericUpdater-... YourVirtualAppName-...

如果您查看基于该订单的最新订单(或仅查看最近创建的订单),您可以查看最后是否记录了任何错误?

于 2014-12-15T14:57:14.877 回答