4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Java8移行に伴う環境構築

Posted at

前回、brew caskでJava8をインストールという記事を書きましたが、Java8を入れた後の環境構築までセットで行う必要があります。

※ 下記内容は「mavenプロジェクト」を「Eclipse」で管理している場合に有効かと思われます。

1. MavenでコンパイルするJavaのバージョンを8にする

pom.xmlのpluginのsourceとtargetを1.8にする。

pom.xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.2</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

mavenを書き換えたら、

1. 修正を加えたpom.xmlを含むディレクトリを右クリック
2. Maven → Update Project… をクリック

の手順により、変更内容をEclipseに読ませてあげる。

2. Eclipse環境設定をJava8にする

  • Java > Compiler:Compiler compliance levelを1.8にする
  • Java > Installed JREs:Java8のJVMを追加する

3. おまけ

Eclipseが、An internal error occurred during: "Building workspace". GC overhead limit exceededというエラーを吐き出すことがある。
この時、eclipse.iniのXms・Xmx・MaxPemSizeの内容を

-Xms512m
-Xmx1024m
-XX:MaxPermSize=1024m

などとし、数値を大きくしてあげることでGCエラーを回避出来うる。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?