Starting Tests with java 8 not working (java.lang.UnsupportedClassVersionError)

オープン
#590 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java
領域
build-system

調査の方向性

The reporter gives a full stack trace and a minimal test class, so the failure is reproducible: RemoteTestNG is compiled to class file 55 (Java 11) while the runtime is 52 (Java 8). Start by finding where the launcher classes are built — the Tycho pom.xml and the plug-in META-INF/MANIFEST.MF Bundle-RequiredExecutionEnvironment — and confirm which compiler source/target the remote launcher module uses. Done means the launcher artifacts carry Java 8 bytecode and the sample TestNG class runs under a Java 8 JRE.

索引モデルが issue の本文から書いたものです。

説明

After the new release #586 the issue #583 seems to be fixed but I still cannot run TestNG-Tests in Java 8 projects due to this exception:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/testng/remote/RemoteTestNG has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)

My test-class looks like this

import org.testng.Assert;
import org.testng.annotations.Test;

public class JavaTest
{
  @Test
  public void test()
  {
    Assert.assertTrue(false);
  }
}

主要言語
Java
スター
198
フォーク
163
平均マージ
4分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testng-team/testng-eclipse のほかの issue

testng-team/testng-eclipse の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。