mac java jar文件,如何在mac中运行.jar?

本文讨论了一个Java应用程序在Windows环境下运行正常,但在没有安装JDK的Mac上无法运行的问题。解决方法是,用户不需要JDK来运行基于Java的程序,只需要JRE。对于MacOS 10及以上版本,由于Java不再自动安装,因此需要手动安装JRE才能执行Java程序。
摘要由CSDN通过智能技术生成

Ok, so i've written a relatively simple java application. I have JDK on my PC, but I need it to run on a mac for school. The .jar runs perfectly on my PC, but I tested it on my macintosh (which, btw, does not have JDK installed). So...why isn't it running on mac? How can I fix this? Is fixing it even possible?

解决方案

You don't need JDK to run Java based programs. JDK is for development which stands for Java Development Kit.

You need JRE which should be there in Mac.

Try: java -jar Myjar_file.jar

EDIT: According to this article, for Mac OS 10

The Java runtime is no longer installed automatically as part of the

OS installation.

Then, you need to install JRE to your machine.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值