简体   繁体   English

在Ubuntu终端安装Xilinx时无法解决Java Sun报错

[英]Cannot solve Java Sun error when installing Xilinx in Ubuntu Terminal

I recently made a post detailing an issue with creating a RedPitaya ecosystem on my Windows 11 laptop and wanted to see if my Windows 10 desktop had anymore luck.我最近发表了一篇文章,详细介绍了在我的 Windows 11 笔记本电脑上创建 RedPitaya 生态系统的问题,并想看看我的 Windows 10 台式机是否还有运气。

After installing Ubuntu 20.04.5 LTS (Focal Fossa) via Microsoft Store, I faked my OS to 18.04.4 (Bionic Beaver) which is required to avoid issues with Xilinx installer.通过 Microsoft Store 安装 Ubuntu 20.04.5 LTS (Focal Fossa) 后,我将我的操作系统伪造为 18.04.4 (Bionic Beaver),这是避免 Xilinx 安装程序出现问题所必需的。 I attempted to install Xilinx Unified 2020.1 via我试图通过以下方式安装 Xilinx Unified 2020.1

chmod +x ./Xilinx_Unified_2020.1_0602_1208_Lin64.bin
sudo ./Xilinx_Unified_2020.1_0602_1208_Lin64.bin

but I ran into this common error:但我遇到了这个常见错误:

ERROR: Installer could not be started.
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
java.awt.HeadlessException:

Following other StackOverflow answers (namely this one ), I set my DISPLAY variable to localhost:0.0 , :0.0 , :0 , and unset it, all of which resulted in the following error message:按照其他 StackOverflow 答案(即这个答案),我将我的DISPLAY变量设置为localhost:0.0:0.0:0并取消设置,所有这些都会导致以下错误消息:

ERROR: Installer could not be started. Could not initialize class sun.awt.X11GraphicsEnvironment
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at java.desktop/java.awt.GraphicsEnvironment.createGE(Unknown Source)
        at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
        at java.desktop/java.awt.Window.initGC(Unknown Source)
        at java.desktop/java.awt.Window.init(Unknown Source)
        at java.desktop/java.awt.Window.<init>(Unknown Source)
        at java.desktop/java.awt.Frame.<init>(Unknown Source)
        at java.desktop/java.awt.Frame.<init>(Unknown Source)
        at java.desktop/javax.swing.JFrame.<init>(Unknown Source)
        at h.b.<init>(Unknown Source)
        at com.xilinx.installer.gui.F.<init>(Unknown Source)
        at com.xilinx.installer.gui.InstallerGUI.<init>(Unknown Source)
        at com.xilinx.installer.gui.InstallerGUI.<clinit>(Unknown Source)
        at com.xilinx.installer.api.InstallerLauncher.main(Unknown Source)

When installing Xilinx on my laptop I kept a record of what solved my errors, and I wrote that installing OpenJDK via在我的笔记本电脑上安装 Xilinx 时,我记录了解决错误的方法,并写下了通过以下方式安装 OpenJDK

sudo apt-get install openjdk-6-jdk
sudo apt-get install openjdk-6-jre

solved my issue, but on my desktop this is not the case.解决了我的问题,但在我的桌面上情况并非如此。 I have attempted with several versions of Java (including Java 8, 17, and 19) from both OpenJDK and Oracle, and I have installed them by either.tar.gz files, repositories, or terminal install commands.我已经尝试使用来自 OpenJDK 和 Oracle 的几个版本的 Java(包括 Java 8、17 和 19),并且我已经通过 .tar.gz 文件、存储库或终端安装命令安装了它们。

Currently I am running目前我正在跑步

java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

and receiving the error message.并收到错误消息。

Any help using OpenJDK or Oracle is appreciated.感谢使用 OpenJDK 或 Oracle 的任何帮助。

I am running x64 Windows 10 Home 21H2, OS Build 19044.2251, and I am unable to update to Windows 11 (error code 0xc1900101).我正在运行 x64 Windows 10 Home 21H2,OS Build 19044.2251,我无法更新到 Windows 11(错误代码 0xc1900101)。 I have also installed Ubuntu through Windows Subsystem for Linux, and that has not resulted in any different results.我还为 Linux 安装了 Ubuntu 到 Windows 子系统,并没有产生任何不同的结果。

I was able to install Vitis/Vivado in a WSL environment by following this guide (the main steps of which I will leave at the end in case the link breaks): https://cadhut.com/2020/09/08/how-to-install-vivado-vitis-using-just-the-command-line/我能够按照本指南在 WSL 环境中安装 Vitis/Vivado(如果链接断开,我将在最后留下主要步骤): https://cadhut.com/2020/09/08/how -仅使用命令行安装-vivado-vitis/

The issue (I believe) is that the installer is trying to launch its GUI, but cannot because WSL does not support that like a native Ubuntu install would.问题(我相信)是安装程序正在尝试启动其 GUI,但不能启动,因为 WSL 不像本机 Ubuntu 安装那样支持它。 NOTE I am fairly certain that installing on the CLI like this will not allow you to launch the Vitis/vivado GUIs even if you are successful, so if you need those, you likely want to look at dual booting a native Ubuntu install of the correct version OR installing Xilinx tools in a Linux VM (I have used oracle VMWare for this in the past with success).注意我相当确定像这样在 CLI 上安装将不允许您启动 Vitis/vivado GUI,即使您成功了,所以如果您需要这些,您可能想要查看双引导本机 Ubuntu 安装正确的版本或在 Linux VM 中安装 Xilinx 工具(我过去曾为此成功使用过 oracle VMWare)。 The point of installing in WSL for me was to run builds in batch mode/via CLI and scripts.对我来说,在 WSL 中安装的目的是以批处理模式/通过 CLI 和脚本运行构建。

Also;还; I am not sure what you mean by 'faking' your OS version, but for the most part those warnings about supported OS can be ignored if you're willing to occasionally troubleshoot python version issues and such.我不确定你所说的“伪造”你的操作系统版本是什么意思,但在大多数情况下,如果你愿意偶尔解决 python 版本问题等,可以忽略那些关于支持的操作系统的警告。 AFAIK it should still let you install on an unsupported OS.据我所知,它仍然可以让您安装在不受支持的操作系统上。 The more important requirement is installing all the required packages and tools.更重要的要求是安装所有必需的包和工具。

Outlined steps from linked guide (should be enough to get someone started):链接指南中的概述步骤(应该足以让某人开始):

#Extract installer files 
tar -zxvf <filename>.tar.gz
#Generate install config (will need to press 1 during this step)
./xsetup -b ConfigGen
#Launch installer with required args 
./xsetup --a XilinxEULA,3rdPartyEULA,WebTalkTerms -b Install -c /home/<user>/.Xilinx/install_config.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM