英文:
Java Virtual Machines deleted
问题
我意外删除了Java虚拟机文件夹,通过终端?我已经检查了垃圾箱,找不到它。
有办法把它恢复吗?
我需要那个文件夹让我的IntelliJ工作。
我检查过垃圾箱,也在网上找过重新安装Java,但似乎没有办法恢复这个文件夹。
它曾经在的目录是/Library/Java/Java Virtual Machine
英文:
I accidently deleted the Java Virtual Machines folder, via terminal? I have checked the trash, I can't find it there.
Is there anyway to bring it back?
I need that folder back for my intellJ to work
I've checked trash folder, and looked around online to reinstall java, but nothing seems to bring the folder back.
The directory it used to be in is /Library/Java/Java Virtual Machine
答案1
得分: 4
安装新的JDK
你说:
>我不小心通过终端删除了Java虚拟机文件夹?
- 在Mac上,如果你用Finder应用程序删除了,文件会在Trash中。要恢复,从Trash文件夹中拖回 🗑️。
- 如果你在控制台中使用命令行删除,比如Terminal应用程序,那么文件就消失了,消失了 💨。无法恢复,除非像data rescue recovery专家一样入侵计算机存储。
但别惊慌;不是个大问题。
👉只需从你选择的供应商那里安装新的JDK。
供应商包括但不限于:BellSoft、Microsoft、Amazon、Oracle、Red Hat、IBM、SAP、Adoptium、Azul Systems等。
这些供应商的大多数JDK产品基本上或完全基于在OpenJDK项目中开发的源代码。一些JDK产品是免费的,一些是商业产品。务必研究你获取的任何JDK的许可条款。
IntelliJ IDE
你说:
>我需要那个文件夹让我的IntelliJ工作
这并不完全正确。
你安装的IntelliJ IDE 自带了自己的JDK副本。因此,IntelliJ可以独立启动和运行。IntelliJ本身不需要外部JDK。
你确实需要为你的应用程序指定一个外部JDK来构建和运行。选择 File | Project Structure | Platform Settings | SDKs
。查看IntelliJ文档。
- 从供应商那里获取一个JDK。
- 安装该JDK。
- 在你的IntelliJ项目中,指定你希望你的应用程序使用特定的JDK构建和运行。
提示:
- 最近的IntelliJ版本提供了一个便利功能,可以同时从上述供应商的子集中下载并安装JDK。参见下载JDK由Helen Scott编写的文章。和查看手册。
- 我目前在我的Mac上使用SDKMAN!实用程序安装和移除JDK产品。这套精巧的shell脚本在面向Unix的环境中工作。SDKMAN!提供来自选择向SDKMAN!数据库报告其产品的任何供应商的JDK产品。
- 如果你对任何特定的供应商没有偏好,我建议从Adoptium开始,这是由Eclipse Foundation支持的项目。
英文:
tl;dr
- Just install a fresh JDK. Then configure your project to use that JDK.
- IntelliJ contains its own JDK to run itself.
- IntelliJ can download and install a JDK from any of multiple vendors, for use by your project.
- I recommend instead using SDKMAN! utility for more serious work.
Just install a fresh JDK
You said:
>I accidently deleted the Java Virtual Machines folder, via terminal?
- On a Mac, if you deleted with the Finder app, the files will be in the Trash. To retrieve, drag from the Trash folder 🗑️.
- If you deleted with the command-line in a console such as the Terminal app, then the files are gone, poof 💨. No way to retrieve, short of hacking the computer storage as done by data rescue recovery experts.
But don’t panic; not a big problem.
👉 Simply install a new JDK from your choice of vendor.
Vendors include, in no particular order: BellSoft, Microsoft, Amazon, Oracle, Red Hat, IBM, SAP, Adoptium, Azul Systems, and more.
Most of the JDK products across those vendors are based largely, if not entirely, on the source code developed at the OpenJDK project. Some JDK products are free of cost, some are commercial products. Be sure to study the license terms of any JDK you obtain.
IntelliJ IDE
You said:
> I need that folder back for my intellJ to work
That is not quite true.
Your installation of the IntelliJ IDE comes bundled with its own copy of a JDK. So IntelliJ can boot and run on its own. IntelliJ itself does not require an external JDK.
You do need to specify an external JDK for your app to build and run. Select File | Project Structure | Platform Settings | SDKs
. See IntelliJ documentation.
- Obtain a JDK from a vendor.
- Install that JDK.
- In your IntelliJ project, specify that you want your app to be built with, and run on, that particular JDK.
Tips:
- Recent versions of IntelliJ offer a convenience feature to both download and install a JDK from a subset of the vendors listed above. See Download a JDK by Helen Scott of JetBrains. And see the manual.
- I am currently using the SDKMAN! utility on my Mac to install and remove JDK products. This slick kit of shell scripts works in Unix-oriented environments. SDKMAN! offers JDK products from any vendor that chooses to report their offerings to the SDKMAN! database.
- If you've no affinity for any particular vendor, I suggest starting with Adoptium, a project at the Eclipse Foundation supported by several other JDK vendors.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论