从Eclipse IDE创建Runnable JAR [英] Creating Runnable JAR from Eclipse IDE

查看:178
本文介绍了从Eclipse IDE创建Runnable JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查看了很多网页上的信息,还会看到这里的一些问题,但无法解决我的问题,所以我发布了这个问题。我有相当简单的项目,使用在Eclipse下编译和运行的 SWING ,但是当我尝试使用标准的 Export-> Java-> Runnable Jar 最后留下默认属性我有一个文件,当我dobule点击我得到这个:找不到主类:TableFilterDemo。程序将退出
这是我的项目结构:

I look over a lot of info on the web also look at some of the questions here, but couldn't solve my problem so I post this question. I have fairly simple project using SWING which compiles and run under Eclipse, but when I try to use the standard Export->Java->Runnable Jar leaving the default properties at the end I have a file which when I dobule-click I get this: Could not find the main class: TableFilterDemo. Program will exit. Here is my project structure:

这是我用于创建 Runnable Jar 的配置:

And this is the configuration I use for creating the Runnable Jar :

因为据了解错误,找到 main 方法有一些问题我离开 TableFilterDremo.java 只包含 main 方法:

And because as far as I understand the error there is some problem with locating the main method I left TableFilterDremo.java with only the main method in it:

public class TableFilterDemo{
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                CreateGUI.createAndShowGUI();
            }
        });
    }
}

迄今没有成功。

推荐答案

如果您浏览Eclipse提供的完整向导,您将看到有一个屏幕提示您选择主类。

If you go through the full wizard that Eclipse provides, you'll see there is a screen prompting you to select a main class.

这篇关于从Eclipse IDE创建Runnable JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆