0
0

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 1 year has passed since last update.

Java関連の設定

Last updated at Posted at 2022-10-12

Java文字コード設定

Windowsのシステム環境変数に以下を追加する。
※確かJenkinsのコンソール文字化け対策で実施しました。

JAVA_TOOL_OPTIONS
-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8

Tomcatのメモリ設定

Tomcatの conf/context.xml に以下を追加する。

<Context>
   <!-- 省略 -->
   <Resources cacheMaxSize="51200" />
</Context>

新しいEclipseで古いmavenプロジェクトを開いた時のエラー対策

Exception java.lang.ExceptionInInitializerError [in thread "Worker-42: ビルド"]

不可解なエラーで解決方法が全く見えない。
buildタグのpluginsタグに、maven-war-pluginの設定を追加すると解消されます。

    <build>
        <finalName>asboxZurichService</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!--<version>3.6.1</version>-->
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <!-- ↓↓↓新しいEclipseで開く時は必要↓↓↓ -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.1</version>
            </plugin>
            <!-- ↑↑↑新しいEclipseで開く時は必要↑↑↑ -->
        </plugins>
    </build>

IPv4を使うオプション

-Djava.net.preferIPv4Stack=true

mavenでSpringBootを起動するコマンド

mvn spring-boot:run -Dspring-boot.run.profiles=dev,local
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?