質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Eclipse

Eclipseは、IBM社で開発された統合開発環境のひとつです。2001年11月にオープンソース化されました。 たくさんのプラグインがあり自由に機能を追加をすることができるため、開発ツールにおける共通プラットフォームとして位置づけられています。 Eclipse自体は、Javaで実装されています。

Q&A

解決済

1回答

1193閲覧

【Java】【Eclipse】Mavenプロジェクトのエラー

lotadcate

総合スコア24

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Eclipse

Eclipseは、IBM社で開発された統合開発環境のひとつです。2001年11月にオープンソース化されました。 たくさんのプラグインがあり自由に機能を追加をすることができるため、開発ツールにおける共通プラットフォームとして位置づけられています。 Eclipse自体は、Javaで実装されています。

0グッド

1クリップ

投稿2022/07/21 02:52

編集2022/07/21 12:49

質問

EclipseでMavenプロジェクトを立ち上げてEvosuiteを使おうとしたのですがエラーが発生しました。

発生している問題・エラーメッセージ

Failed to execute goal org.evosuite.plugins:evosuite-maven-plugin:1.0.6:generate (default-cli) on project evosuitetest: Execution default-cli of goal org.evosuite.plugins:evosuite-maven-plugin:1.0.6:generate failed: Plugin org.evosuite.plugins:evosuite-maven-plugin:1.0.6 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.0.0 at specified path C:\jdk-18.0.1.1/../lib/tools.jar -> [Help 1]

エラー内容

com.sun:tools:jar:1.0.0C:\jdk-18.0.1.1/../lib/tools.jarに見つけれないよ、ということでしょうか。
com.sun ということはオラクルのつくったツールということでしょうか。
OpenJDKをつかっているのですがOracleJDKじゃないと動かないということでしょうか。
よくわかっていないですがOracleJDKは有料らしいのでOpenJDKで動くようにしたいです。

該当のソースコード

pom.xmlの内容です
公式ページの通りにやったつもりです。

xml

1<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 2 <modelVersion>4.0.0</modelVersion> 3 <groupId>com.evosuitetest</groupId> 4 <artifactId>evosuitetest</artifactId> 5 <version>0.0.1-SNAPSHOT</version> 6 7 <properties> 8 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 9 <maven.compiler.source>1.8</maven.compiler.source> 10 <maven.compiler.target>1.8</maven.compiler.target> 11 <evosuiteVersion>1.0.6</evosuiteVersion> 12 </properties> 13 <repositories> 14 <repository> 15 <id>EvoSuite</id> 16 <name>EvoSuite Repository</name> 17 <url>http://www.evosuite.org/m2</url> 18 </repository> 19 </repositories> 20 21 <pluginRepositories> 22 <pluginRepository> 23 <id>EvoSuite</id> 24 <name>EvoSuite Repository</name> 25 <url>http://www.evosuite.org/m2</url> 26 </pluginRepository> 27 </pluginRepositories> 28 <build> 29 <pluginManagement> 30 <plugins> 31 <plugin> 32 <groupId>org.evosuite.plugins</groupId> 33 <artifactId>evosuite-maven-plugin</artifactId> 34 <version>${evosuiteVersion}</version> 35 <executions> 36 <execution> 37 <goals> 38 <goal> prepare </goal> 39 </goals> 40 <phase> process-test-classes </phase> 41 </execution> 42 </executions> 43 </plugin> 44 <plugin> 45 <groupId>org.codehaus.mojo</groupId> 46 <artifactId>build-helper-maven-plugin</artifactId> 47 <version>1.8</version> 48 <executions> 49 <execution> 50 <id>add-test-source</id> 51 <phase>generate-test-sources</phase> 52 <goals> 53 <goal>add-test-source</goal> 54 </goals> 55 <configuration> 56 <sources> 57 <source>${customFolder}</source> 58 </sources> 59 </configuration> 60 </execution> 61 </executions> 62 </plugin> 63 <plugin> 64 <groupId>org.apache.maven.plugins</groupId> 65 <artifactId>maven-surefire-plugin</artifactId> 66 <version>2.17</version> 67 <configuration> 68 <properties> 69 <property> 70 <name>listener</name> 71 <value>org.evosuite.runtime.InitializingListener</value> 72 </property> 73 </properties> 74 </configuration> 75 </plugin> 76 </plugins> 77 </pluginManagement> 78 </build> 79 <dependencies> 80 <dependency> 81 <groupId>org.evosuite</groupId> 82 <artifactId>evosuite-standalone-runtime</artifactId> 83 <version>${evosuiteVersion}</version> 84 <scope>test</scope> 85 </dependency> 86 <dependency> 87 <groupId>junit</groupId> 88 <artifactId>junit</artifactId> 89 <version>4.12</version> 90 <scope>test</scope> 91 </dependency> 92 93 </dependencies> 94</project>

試したこと

com.sun/tools/1.0.0 より

xml

1<!-- https://mvnrepository.com/artifact/com.sun/tools --> 2<dependency> 3 <groupId>com.sun</groupId> 4 <artifactId>tools</artifactId> 5 <version>1.0.0</version> 6 <scope>system</scope> 7</dependency>

を入れてみましたが動きませんでした。
buildの中のdependeciesに追記しました)

補足情報(FW/ツールのバージョンなど)

javaのバージョン:openjdk version "18.0.1.1"
mavenのバージョン:Apache Maven 3.8.6

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

tool.jarはJDK9で削除されていますので、利用するJDKのバージョンをJDK8に変更するか、EvosuiteのバージョンをJDK9以降に対応したものに変える必要があると思います。

参考: https://docs.oracle.com/javase/jp/11/migrate/index.html#JSMIG-GUID-A78CC891-701D-4549-AA4E-B8DD90228B4B

投稿2022/07/21 12:56

neko_the_shadow

総合スコア2230

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

lotadcate

2022/07/24 07:16

返信遅れまして申し訳ございません。 > tool.jarはJDK9で削除されていますので ご指摘の通りでした。JDK9以降に対応したevosuiteのmavenプラグインが開発されていないようなのでjdk8でやってみることにします。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問