Visual Studio 代码中的 Java [英] Java in Visual Studio Code

查看:29
本文介绍了Visual Studio 代码中的 Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Visual Studio Code 中设置 JAVA,但无法使其正常工作.我收到一条错误消息,指出加载主类 Hello 时发生链接错误".我研究了许多网站,但没有找到任何我理解的解决方案.例如,我看到几个网站声明您必须在某些设置上启用预览",但没有关于如何实际执行此操作的说明.我已经安装了 jdk-11.0.4 jdk 版本.我从来没有用java编程所以我不知道需要什么.我查看了几个你管的视频,当然他们的安装没有任何问题!这里有人可以帮忙吗?

I am attempting to set up JAVA in Visual Studio Code and I can not get it working. I am getting an error that states "Linkage Error occurred while loading main class Hello". I have researched numerous sites and have not found any solutions that I understand. For example, I have seen several sites that state you must "enable-preview" on some setting but there are no directions on how to actually do that. I have installed the jdk-11.0.4 jdk version. I have never programmed in java so I do not know what is required. I reviewed several you tube videos and of course their installation went off without any problems! Is there anyone here that can help?

推荐答案

根据他们的文档链接,有两种方法可以使用 VS 代码设置和运行 java

As per their documentation link, there are two ways to setup and run java with VS code

  1. 他们为 Java 开发人员创建了一个特殊的 Visual Studio Code 安装程序.该软件包可用作现有开发环境的全新安装或更新,以添加 Java 或 Visual Studio Code.

  1. They have created a special Installer of Visual Studio Code for Java developers. The package can be used as a clean install or an update for an existing development environment to add Java or Visual Studio Code.

Java 开发人员的 Visual Studio Code 安装程序

或者,您也可以通过自己安装流行的 Java 扩展来为 VS Code 添加 Java 语言支持.

Alternatively, you can also add Java language support to VS Code by installing the popular Java extensions by yourself.

请参阅下面的链接进行设置,如果您在使用 VS Code 设置和运行 Java 时遇到任何问题,请告诉我.

Please see link below to setup and let me know if you face any issue in setting up and run java with VS Code.

Visual Studio Code 中的 Java

不识别Java可能有两个原因

There might be two reason to not identifying Java

  1. 可能是java没有正确安装
  2. 或者安装了多个版本所以可能有冲突

这篇关于Visual Studio 代码中的 Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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