クマは森で用を足しますか?

アウトプットは重要です。

JDK10じゃビルドできないんですか?

Global Platformのお作法ではJava Cardアプレットをロードさせてもらえなさそうなので、まずはsysmoUSIM-SJS1 4FFのマニュアルやwikiで「できる」とされていること、SIMツールキット用アプレットの実装サンプルとして提供されている "Hello STK" のビルドから手をつけます。

cheerio-the-bear.hatenablog.com

JDK8が必要でした

Hello STKのソースは、こちらで参照することができます。wikiに書かれている通りにやります。Git for Windowsを開発環境に導入し、ソースコードをダウンロードしてビルド。でも、何やらエラーが出るようです。

$ git clone git://git.osmocom.org/sim/sim-tools/
$ git clone git://git.osmocom.org/sim/hello-stk
$ cd hello-stk
$ make

javacのパラメータに-J-Duser.language=enを追加して、出力されるエラーメッセージを読めるようにしてみる。なるほど、JDK10は-target 1.1 -source 1.3を受け付けません。本件では「ビルドに成功したもの」は「動くもの」であって欲しいので、-target 1.1 -source 1.3に従うためにJDK8を追加でインストール。.bashrcに反映して再度ビルドを実行したら、今度はHello STKのcapファイルが生成されました。

$ make
mkdir -p ./build/classes
mkdir -p ./build/javacard
javac -target 1.1 -source 1.3 -J-Duser.language=en -g -d ./build/classes -classpath "../sim-tools/javacard/lib/api21.jar;../sim-tools/javacard/lib/sim.jar" src/org/toorcamp/HelloSTK/HelloSTK.java
warning: [options] bootstrap class path not set in conjunction with -source 1.3
warning: [options] source value 1.3 is obsolete and will be removed in a future release
warning: [options] target value 1.1 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
java -jar ../sim-tools/javacard/bin/converter.jar  \
        -d ./build/javacard                    \
        -classdir ./build/classes              \
        -exportpath ../sim-tools/javacard/api21_export_files          \
        -applet 0xd0:0x70:0x02:0xca:0x44:0x90:0x01:0x01 org.toorcamp.HelloSTK.HelloSTK        \
        org.toorcamp.HelloSTK 0xd0:0x70:0x02:0xCA:0x44:0x90:0x01 1.0

Java Card 2.1.2 Class File Converter (version 1.2)
Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.

conversion completed with 0 errors and 0 warnings.

互換性の問題など、何らかの理由があって指定されているパラメータなんでしょう。外してビルドすると、カード上では動かないものになってしまうのかどうか。その必要に迫られることがあれば、試してみましょう。

次は、生成されたアプレットのロードとインストールです。