Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Intellij idea 将jdk8构建迁移到jdk9时,是什么导致OutOfMemoryError?_Intellij Idea_Junit_Maven 3_Java 9 - Fatal编程技术网

Intellij idea 将jdk8构建迁移到jdk9时,是什么导致OutOfMemoryError?

Intellij idea 将jdk8构建迁移到jdk9时,是什么导致OutOfMemoryError?,intellij-idea,junit,maven-3,java-9,Intellij Idea,Junit,Maven 3,Java 9,我正在从jdk 8->jdk 9迁移junit 4->junit 5的poc 的构建在我的jigsaw分支中失败,出现java.lang.OutOfMemoryError。我可以根据我的想法(IntelliJ idea 2017.1)运行这些测试,但使用maven构建时会出现错误(并且测试不会执行) mvn--版本: Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) M

我正在从jdk 8->jdk 9迁移junit 4->junit 5的poc

的构建在我的jigsaw分支中失败,出现
java.lang.OutOfMemoryError
。我可以根据我的想法(IntelliJ idea 2017.1)运行这些测试,但使用maven构建时会出现错误(并且测试不会执行)

mvn--版本

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /Library/maven
Java version: 9-ea, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: en_NO, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+167)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+167, mixed mode)
java-version

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /Library/maven
Java version: 9-ea, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: en_NO, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+167)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+167, mixed mode)
pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.jactor-rises</groupId>
    <artifactId>junit-poc</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>junit-poc</name>
    <url>https://github.com/jactor-rises/junit-poc</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.0.0-M4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.0.0-M4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>2.7.22</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.0.0-M4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>1.0.0-M4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-runner</artifactId>
            <version>1.0.0-M4</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>9</source>
                    <target>9</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>1.0.0-M4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.vintage</groupId>
                        <artifactId>junit-vintage-engine</artifactId>
                        <version>4.12.0-M4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>5.0.0-M4</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>
我为任何可能知道要找什么的人创建了一个正则小提琴。。。()

这让我头疼。。。 它在IntelliJ中运行良好,如堆栈跟踪所示,它源自surefire插件内部的
AbstractStringBuilder
。这些是正在使用的人工制品:

<artifactId>junit-platform-surefire-provider</artifactId>...
<artifactId>junit-vintage-engine</artifactId>...
<artifactId>junit-jupiter-engine</artifactId>...

Java 9将其字符串表示形式从字符改为使用字节。我想答案就在这里。你在什么地方使用了很多特殊字符吗?

这通过一些新的java版本或surefire插件版本解决了


我现在正在使用openjdk 13和surefire插件2.22.0

这是一个有趣的可能性。。。我不这么认为。。。我怎么查?非常欢迎您在Maven进程崩溃时对其进行堆转储来检查我的代码。(在Maven选项中放入XX:+HeapDumpOnOutOfMemoryError。)好的。。。我有什么特别需要的吗?我没有在执行堆转储时读取maven输出的经验。。。结果日志非常大…@RafaelWinterhalter确实int已更改,但这应该会减少字符串使用的内存,而不是增加它。您还有其他建议吗?请看一下我的堆转储文件:()这似乎是一个专业问题。它在intellij中工作,当使用
mvn clean install-X
运行时,只有apache.maven和codehaus.plexus是堆栈跟踪的一部分(java内部除外)