IntelliJ可运行的jar在其他计算机上不起作用 [英] IntelliJ runnable jar doesn`t work on other computers

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

问题描述

在IntelliJ中,我创建了一个简单程序(我是初学者),我试图创建可运行的JAR文件,以便可以在其他计算机上运行该程序.但是,当我在另一台计算机上尝试时,它给了我这个错误,我不确定是在计算机上还是在可运行的JAR上出了点问题:发生了JNI错误.请检查您的安装,然后重试".但是,如果我在计算机上运行该程序,它就可以完美运行.

In IntelliJ I created a simple program(Im a beginner) and Im trying to create a runnable JAR file so I can run the program on a different computer. But when I tried it on a different computer, It gave me this error, Im not sure if its something wrong on the computer or the runnable JAR:"A JNI error has occured. Please check your installation and try again". However It works perfectly if I run the program on my computer.

我使用以下指南创建了可运行的JAR:

I created runnable JAR using this guide: https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html

有人可以告诉我我做错了吗?

Can someone tell me what I did wrong?

推荐答案

JNI是Java本机接口,它负责本机库.如果您不关心它们,它们就不在您的JAR中.如果在创建jar文件时选择选项,大多数IDE都可以为您自动包含该libs:)

JNI is a java native interface and it is responsible for native libraries. They are not in your JAR if you don't cared about it. Most IDEs can autoinclude that libs for you if you select option while creating jar file :)

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

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