创建Jar文件 - 在其他计算机上不起作用 [英] Creating Jar file - doesn't work on other computers

查看:198
本文介绍了创建Jar文件 - 在其他计算机上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的程序打包成一个JAR文件,以便可以在多台计算机上使用。

I'm trying to package my program into a JAR file so it can be used on multiple computers.

我的程序由组成start.java userinterface.java writer.java

用Eclipse编写的程序在我的计算机上运行良好。导出时,它将在我的计算机上运行但在其他计算机上导致以下错误:

The program, written in Eclipse, works perfectly on my computer. When exported, it will work on my computer but cause the following error on other computers:

找不到主类:start。程序将退出。

再次,当我双击它时,我的程序在我的电脑上正常运行。

Again, my program runs fine on my computer when I double click on it.

我尝试过通过命令提示符创建JAR文件,我的Manifest文件是正确的。发生了什么事?

I've tried creating the JAR file via command prompt, and my Manifest file is correct. What is happening?

推荐答案

这是一个非常奇怪的错误,我也遇到过。

This is a very strange bug which I've also encountered.

假设您使用 JRE 1.7

我发现此问题的唯一解决方法是更改​​项目的 JRE 版本从 1.7 1.6

Assuming you are using JRE 1.7,
The only fix I found to this problem was to change the project's JRE version from 1.7 down to 1.6.

编辑:我在使用JVM 7的计算机上也遇到过此错误。

I've also encountered this error on computers with JVM 7.

这篇关于创建Jar文件 - 在其他计算机上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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