如何在unix上运行.jar文件? [英] How to run .jar file on unix?

查看:306
本文介绍了如何在unix上运行.jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在windows中生成了.jar文件。

我必须在unix中执行.jar文件。

I have generated .jar file in windows.
I have to execute that .jar file in unix .

我正在运行该命令( java -jar myJar.jar ),但它正在给予

I am running that command (java -jar myJar.jar), but it's giving

 java.lang.UnsupportedVersionError

我在Unix中使用java版本1.5.0.12。

I am using java version 1.5.0.12 in Unix.

推荐答案

 java.lang.UnsupportedVersionError

您必须尝试使用​​本地java1.5启动使用JDK6编译的jar。

You must be trying to launch a jar compiled with JDK6, with a local java1.5.

您可以:


  • 将你在Unix上的jvm升级到1.6

  • 或者用重新编译你的类li>
  • upgrade your jvm on Unix to 1.6
  • or re-compile your classes with a

  javac -source 1.5 -target 1.5 -bootclasspath /path/to/jre1.5/lib/rt.jar

要检查如果你可以生成1.5字节码兼容。

to check if you can generate 1.5 bytecode compatible.

这篇关于如何在unix上运行.jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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