IntelliJ JavaDoc - 错误 - 无法读取输入长度 = 1 [英] IntelliJ JavaDoc - error - cannot read Input length = 1

查看:39
本文介绍了IntelliJ JavaDoc - 错误 - 无法读取输入长度 = 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有很多关于这个问题的问题,但没有人为我解决它!我正在使用 IntelliJ 的社区版,并尝试通过 IDE 运行 JavaDoc.每次,无论哪个文件,我运行 JavaDoc 我都会得到以下输出:

javadoc: 错误 - 无法读取输入长度 = 1

我已经发现,这可能是一个编码问题...我正在开发一个 Windows 10 机器.我已经尝试了以下方法:

  • 作为健全性检查,将项目从 Muller 重命名为 Müller 以重新引入错误:

注意事项:

  • 如评论中所述,javadoc_args 文件不存在,我认为无法阻止在 Javadoc 创建过程中使用它.
  • 项目名称为 Müller 不是问题;导致问题的项目文件路径中有 ü.
  • 环境:Windows 10 + Intellij IDEA 2018 3.1 EAP(终极版)+ Open JDK 10.
  • 我为此向 JetBrains 提出了错误报告:https://youtrack.jetbrains.com/issue/IDEA-202849
<小时>

11/25/18 更新

这个问题有一个解决方法,不需要重命名项目的路径:

  • 运行生成 Javadoc,让它失败.
  • 单击 Javadoc 窗口中显示的文件 .../javadoc_args 的链接.
  • 将文件 javadoc_args 的内容复制并粘贴到文本编辑器中.
  • 更正所有误传的字符(例如,将 Müller 更改为 Müller).
  • 使用 UTF-8 编码和相同的绝对文件名保存文件.
  • 打开一个命令提示符窗口.
  • 从 Intellij IDEA 的 Javadoc 窗口中复制整个 javadoc.exe 命令并将其粘贴到 命令提示符 窗口中.
  • 提交粘贴的行.它现在可以工作了,因为在文件 javadoc_args 中正确指定了项目的路径.

I know there are plenty of questions about this problem, but no one of the solved it for me! I'm using the Community Edition of IntelliJ and I tried to run JavaDoc through the IDE. Everytime and it doesn't matter fo which file, I run JavaDoc I got the following output:

javadoc: error - cannot read Input length = 1

I already figured out, that it might be an encoding problem... I'm working on a Windows 10 maschine. I already tried the following:

  • JavaDoc argfile encoding error
  • Start the terminal from IntelliJ with cmd.exe /K chcp 65001 instead of the default one cmd.exe to set the charset to UTF-8
  • I also set the project's default charset through the IntelliJ settings to UTF-8 (See: This Guide)

The problem seems to be the javadoc_args file respectively the path to that file... The path is C:UsersSomebody MüllerAppDataLocalTempjavadoc_args. Also if I view the file from IntelliJ, all ü characters are replaced by an unknown symbol.

I know that I could generate the documentation through a maven plugin, but I would prefer to do it via the IntelliJ IDE...

Could somebody identify the problem in detail and/or provide a solution or maybe parts of it?

EDIT

skomisa described the situation/behaviour in easy words:

For me the javadoc_args file does not exist! I see it is named in the Javadoc window as an argument to javadoc.exe, and if I click the link its content is shown in a pop up window within Intellij IDEA, but if I check in File Explorer there is no such file. Is this the case for you as well? I have no idea how it gets generated. Also, I created a project in a folder named Müller and the ü was rendered as � within the popup window that showed the content of javadoc_args.

UPDATE 04/12/2018

As skomisa already commented, JetBrains plans to fix this bug in a future version, likely in version 2019.1 (Build 191.2458).

UPDATE 22/02/2019

I know this question is quite old but it seems to be still relevant. I didn't check up to now if JetBrains fixed the bug but a similar one occurred for me when I try to open an JavaFX fxml externally inside of the SceneBuilder. In another post about renaming a Windows 10 user directory I found a possible workaround at least for Windows users! Just create an additional user directory without ü in the path and link to the existing one:

C:
CDUsers
MKLINK /J Müller Mueller

If you now uses the link as directory for project paths it should work fine.

解决方案

I am unable to generate the Javadoc for a project in Intellij IDEA if the name of the path contains the character ü (u with umlaut). The workaround is to rename the project so that the project directory file path does not contain an umlaut.

To reproduce:

  • Use the project wizard to create a trivial Java Hello World project where the root directory name contains ü. I used Müller for testing purposes.

  • Ensure that the class for main() contains valid Javadoc documentation.

  • Build and run the project to verify that there are no unexpected issues.

  • Select Tools > Generate Javadoc, specify an empty Output Directory and click OK.

  • Javadoc creation fails with the error - cannot read Input length = 1 (shown below), and clicking the link to C:UsersjohndoeAppDataLocalTempjavadoc_args shows that the ü in the file path is (mis)represented as �, which presumably is the cause of the Javadoc error.

  • However, once the root directory is renamed from Müller to Muller (to remove the umlaut) the Javadoc creation works:

  • As a sanity check, rename the project from Muller back to Müller to reintroduce the error:

Notes:

  • As noted in the comments, the javadoc_args file does not exist, and I see no way to prevent its use during the Javadoc creation process.
  • Having the project name as Müller is not an issue; it's having ü within the project's file path that causes the problem.
  • Environment: Windows 10 + Intellij IDEA 2018 3.1 EAP (Ultimate Edition) + Open JDK 10.
  • I raised a bug report with JetBrains for this: https://youtrack.jetbrains.com/issue/IDEA-202849

Update 11/25/18

There is a workaround for this issue without needing to rename the project's path:

  • Run Generate Javadoc and let it fail.
  • Click the link to the file .../javadoc_args shown in the Javadoc window.
  • Copy and paste the content of the file javadoc_args into a text editor.
  • Correct any characters that are misrepresented (e.g. change M�ller to Müller).
  • Save the file using UTF-8 encoding, and the same absolute filename.
  • Open a Command Prompt window.
  • Copy the entire javadoc.exe command from the Javadoc window in Intellij IDEA and paste it to the Command Prompt window.
  • Submit the line that was pasted. It will now work because the project's path is correctly specified in the file javadoc_args.

这篇关于IntelliJ JavaDoc - 错误 - 无法读取输入长度 = 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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