内部错误(java.nio.file.invalidpathException):索引 34 处存在非法字符<?>

问题描述 投票:0回答:2
尝试简单的junit测试....

public class ZZZZ { private int a; public ZZZZ() { } public int test(int a){ return a/a; } }
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class ZZZZTest1 {


    private int a = 1;

    ZZZZ nov = new ZZZZ();

    @Test
    public void testtt(){
        assertEquals(6, nov.test(a));
    }
}
我明白了......我不知道该怎么做,因为我不是真正有经验的 intellij java 用户

Internal error (java.nio.file.InvalidPathException): Illegal char <?> at index 34: D:/Fakultet/Programiranje Proekti/????, ??, ????/untitled java.nio.file.InvalidPathException: Illegal char <?> at index 34: D:/Fakultet/Programiranje Proekti/????, ??, ????/untitled at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229) at java.base/java.nio.file.Path.of(Path.java:147) at java.base/java.nio.file.Paths.get(Paths.java:69) at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:87) at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:24) at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:34) at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:64) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:279) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:132) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:219) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)
关于我应该做什么有什么想法吗?

java intellij-idea junit
2个回答
0
投票
@CrazyCoder

将项目移出包含非 ASCII 字符的主目录应该会有所帮助。 –

不知道如何给予代表,我认为这是我能做的最好的事情


0
投票
当我收到此错误时(我的是

Illegal char <:>

),我在
values
文件夹中找到了
attrs.xml
文件中的整个评论并将其删除。现在编译ok了

© www.soinside.com 2019 - 2024. All rights reserved.