Intellij Idea Ubuntu Java 17 openjdk java文档未出现在IntelliJ中

bnlyeluc  于 2023-02-18  发布在  Java
关注(0)|答案(1)|浏览(152)

我无法让openjdk 17 JavaDocs在Ubuntu 20.04上的IntelliJ 2022.3.2 CE中工作。一旦我切换到内部IntelliJ Amazon Corretto 19 SDK-我看到javadoc,但对于openjdk sdk 17,我看到的是反编译代码。

:~$ sudo apt install openjdk-17-
openjdk-17-dbg           openjdk-17-jdk           openjdk-17-jre-headless
openjdk-17-demo          openjdk-17-jdk-headless  openjdk-17-jre-zero
openjdk-17-doc           openjdk-17-jre           openjdk-17-source
:~$ sudo apt install openjdk-17-jdk
openjdk-17-jdk           openjdk-17-jdk-headless  

:~$ sudo apt install openjdk-17-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libxt-dev openjdk-17-jdk-headless openjdk-17-jre openjdk-17-jre-headless
Suggested packages:
  libxt-doc openjdk-17-demo openjdk-17-source visualvm fonts-ipafont-gothic
  fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei
The following NEW packages will be installed
  libxt-dev openjdk-17-jdk openjdk-17-jdk-headless openjdk-17-jre
  openjdk-17-jre-headless
0 to upgrade, 5 to newly install, 0 to remove and 91 not to upgrade.
Need to get 243 MB/287 MB of archives.
After this operation, 447 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 openjdk-17-jdk-headless amd64 17.0.5+8-2ubuntu1~20.04 [243 MB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 openjdk-17-jdk amd64 17.0.5+8-2ubuntu1~20.04 [10.5 kB]
Fetched 65.3 MB in 3s (21.5 MB/s)
:~$ java -version
openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu120.04)
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu120.04, mixed mode, sharing)
:/usr/lib/jvm$ ls
default-java  java-1.11.0-openjdk-amd64  java-1.17.0-openjdk-amd64  java-11-openjdk-amd64  java-17-openjdk-amd64  openjdk-17
:/usr/lib/jvm/java-17-openjdk-amd64/docs$ ls 
api  changelog.Debian.gz  copyright  index.html  JAVA_HOME  legal  README.alternatives  README.Debian  resources  specs  test-amd64

现在Intellij似乎在sdk上指向了这条正确的路径:

但只有我看到:

切换到corretto和一切工作的预期。
值得注意的区别是,Corretto似乎在我提供的IntelliJ屏幕截图中填充了"Sourcepath"部分。

sycxhyv7

sycxhyv71#

明白了这一点,感谢Ubuntu开发人员,我想他们默认提供了JDK的剥离版本,我一直告诉工作站发行版,这种无头的方式只会浪费时间--完全包括或根本不包括,对我自己来说,从头开始正确安装adoptopenjdk会更快。Docker映像或服务器上或云中的任何东西都可以被剥离-很好,但在Linux用户发行版上不行,

    • 溶液**:

卸载安装的任何openjdk-17(包括JRE),并使用源代码为:
:~$ sudo apt install openjdk-17-source
而不是:
:~$ sudo apt install openjdk-17-jdk
就像我在问题示例中做的一样。
在此之后,IntelliJ填充"源路径",类似于它对内部Corretto和JavaDoc作品所做的操作。

相关问题