令和元年5月、6月の開発用メモ

190514

現行版はリストmp3が壊れている (jaydle project)に入っているやつ
階層一番上のものはバッチリっぽい
でも編集機能付いてなかったからだめだ
いやそれはjmmを使うことになってるんだった。

0521火曜日
Public には替えのプロジェクトない
gitディレクトリのが最新なのかな。

Share/share-workspace にもjaydle-projectがあった。
3/8になってる
Error: Could not find or load main class jaydle.Main
となって走らない

jaydleのファイル復習。
正規表現やら、移植やら、スレッドやら、javaならではの大変さ、よくやっているなと思う。これまとめて公開しないと。

Antビルドの件
build.xmlの
<property name=”main-class” location=”Main”/>
がよくわからんな。

いやそれは関係なくて、antの実行、外部ツールから、JREの設定、ワークスペースと同じものつかうにチェックで解決!

Shareにバックアップ取った。そういえば前のバックアップってどこいったんだろ

今度は、二回目のランでエラーでた
クローンしたのもエラーでた
antのプリント見つからない
xmlはプリントアウトした

0528火曜
ビルドはできるようになった。ecjを使って。
でも今度は依存jarをインポートできていない。
jaydleのListMp3FilesとJMMが動かない。
Eclipseから実行だと動く。
EclipseはReferencedLibraryディレクトリのjarを読み込んで、実行可能Jarをビルドしている。そして依存jarを含んでjarを作っている。
Ant版はそれをしていない。
build-auto-by-eclipse-export.xmlのビルドも使えた。
実行可能Jarを作るとき、依存するライブラリをJarにコピーしないといけない。
あとJaydle.jarとJMM.jarの中身がほぼ同じで、Mainだけが違うっぽい。
QiitaのAnt超入門は、Jarが実行可能形式ではない。
Jarの作り方をまた洗わないといけない。
Jarのエントリポイントってなんだ?

6月12日水曜

Mac OSでも作業できるようにShareパーティションにJaydle Workspaceを作った。

antで実行可能jarを作る時、ライブラリのコピーが必要だと思うけど、その辺りの資料なかなか見つからない。公式チュートリアルになっていたかも。

190613 Thu

Still about making a executable jar file using Ant.

Read oreilly’s eclipse book about ant, and official ant page’s top page .

I should read man page of ant and jar. And my blog pages organized about Jaydle, Java, eclipse, ant and etc.

190614 Fri

Changed MacOS eclipse color scheme to classic and indentation to use nextline instead of sameline.

  • Made “Eclipse Workspace” directory in Share partition
  • Made a training project there
  • Eclipse configuration in MacOS (Color scheme, indentation)

 

  1. Make jar file of my utilities
  2. Make executable jar file using Ant (Resolve import error)
  3. Make clear importing process of external jar files
  4. Make Jaydle source code clean and prepare JavaDoc

 

  1. Make jar file of my utilities

I have to determine package name.

MyUtil using mp3agic, so have to solve dependency problem.

 

2.Make executable jar file using Ant (Resolve import error)

Jar file is a archive of class files. so copy this to executable jar and import class files.

190617

Musicbrainz Picard could retagging downloaded MP3 data from their database , but it was a few.

Clouddead – Dead dogs two (BOC Remix)

Common feat Pharrel – Universal mind control

Real love, Can we talk were not found.

LastFM also has database and free API I heard.

Advertisements

Antを使って実行可能Jarをビルドする(EclipseのJava Compilerを使って)

Githubからzipをクローンして、解凍して、そのフォルダにターミナルで移動した。

antコマンドのあとに

Compile Initialize MakeJar Run

という選択肢がでている。書いたbuild.xmlファイルを読み込んでいるからだと思う。

まずMakeJarだと、Initializeを含んでいなくてだめ。

masa@em-p:~/Downloads/jaydle-project-clean_antbuild$ ant MakeJar 
Buildfile: /home/masa/Downloads/jaydle-project-clean_antbuild/build.xml

MakeJar:

BUILD FAILED
/home/masa/Downloads/jaydle-project-clean_antbuild/build.xml:49: /home/masa/Downloads/jaydle-project-clean_antbuild/bin does not exist.

Total time: 0 seconds

Initializeはうまくいった。でもCompileはうまくいかなかった。

Buildfile: /home/masa/Downloads/jaydle-project-clean_antbuild/build.xml

Initialize:
   [delete] Deleting directory /home/masa/Downloads/jaydle-project-clean_antbuild/bin
   [delete] Deleting directory /home/masa/Downloads/jaydle-project-clean_antbuild/jar
    [mkdir] Created dir: /home/masa/Downloads/jaydle-project-clean_antbuild/bin
    [mkdir] Created dir: /home/masa/Downloads/jaydle-project-clean_antbuild/jar

Compile:
    [javac] Since compiler setting isn't classic or modern, ignoring fork setting.

BUILD FAILED
/home/masa/Downloads/jaydle-project-clean_antbuild/build.xml:43: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter

Total time: 0 seconds

というエラーがでた。Eclipseでも同様のエラーが出たが、Antの外部ツール設定でワークスペースと同じJREを使うようにしたら解決した。

今度はどうすればいいのだろう。

 

Eclipseで確認すると、一回目はビルドできるけど、二回目にエラーが出る

Ant build /home/masa/Public/git/jaydle-project/build.xml already in progress. Concurrent Ant builds are possible if you specify to build in a separate JRE.

昨日はできてなかったけな。てか、ハマってたエラー、スタックオーバーフローで質問していて、自分で解答していた。完全に忘れてた。はは。

あとターゲットの”Main Build”がターミナルで選べないのはなんでなんだろう。

 

Eclipseの話に戻ると、これはEclipse再起動で直った。でもMain Buildをするとまた再発。

なんかビルドが終わっていないらしい。

参考(英語)

https://groups.google.com/forum/#!topic/codenameone-discussions/ySxwDy4WzHo

 

実行をすると、Antが終了しないようだ。

話はもどって、

buiild.xmlを見ていると、compileのとこに

<ecj />

でecjの宣言を参照させていなかった。

この一行を追加で

<target name="Compile" depends="Initialize">
<javac 
classpathref="classpath" 
srcdir="${src}" 
destdir="${bin}" 
compiler="org.eclipse.jdt.core.JDTCompilerAdapter"

includeantruntime="false"
source="1.8"
target="1.8"
fork="true" 
debug="true" 
>
<ecj />
<compilerarg value="-Xdiags:verbose"/>
</javac>
</target>
masa@em-p:~/Downloads/jaydle-project-clean_antbuild$ ant Compile 
Buildfile: /home/masa/Downloads/jaydle-project-clean_antbuild/build.xml

Initialize:
   [delete] Deleting directory /home/masa/Downloads/jaydle-project-clean_antbuild/bin
   [delete] Deleting directory /home/masa/Downloads/jaydle-project-clean_antbuild/jar
    [mkdir] Created dir: /home/masa/Downloads/jaydle-project-clean_antbuild/bin
    [mkdir] Created dir: /home/masa/Downloads/jaydle-project-clean_antbuild/jar

Compile:
    [javac] Since compiler setting isn't classic or modern, ignoring fork setting.
    [javac] Since compiler setting isn't classic or modern, ignoring fork setting.
    [javac] Compiling 6 source files to /home/masa/Downloads/jaydle-project-clean_antbuild/bin
    [javac] Since compiler setting isn't classic or modern, ignoring fork setting.
    [javac] org.eclipse.jdt.internal.compiler.problem.AbortCompilation: 
    [javac] 	at org.eclipse.jdt.internal.compiler.batch.Main.initializeAnnotationProcessorManager(Main.java:4559)
    [javac] 	at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4669)
    [javac] 	at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1773)
    [javac] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [javac] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [javac] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [javac] 	at java.lang.reflect.Method.invoke(Method.java:498)
    [javac] 	at org.eclipse.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:80)
    [javac] 	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1160)
    [javac] 	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:936)
    [javac] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
    [javac] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [javac] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [javac] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [javac] 	at java.lang.reflect.Method.invoke(Method.java:498)
    [javac] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [javac] 	at org.apache.tools.ant.Task.perform(Task.java:348)
    [javac] 	at org.apache.tools.ant.Target.execute(Target.java:435)
    [javac] 	at org.apache.tools.ant.Target.performTasks(Target.java:456)
    [javac] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
    [javac] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
    [javac] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    [javac] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
    [javac] 	at org.apache.tools.ant.Main.runBuild(Main.java:853)
    [javac] 	at org.apache.tools.ant.Main.startAnt(Main.java:235)
    [javac] 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
    [javac] 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
    [javac] Unable to load annotation processing manager org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager from classpath.
    [javac] 

BUILD FAILED
/home/masa/Downloads/jaydle-project-clean_antbuild/build.xml:43: Compile failed; see the compiler error output for details.

Total time: 1 second

と、ClassFileNotFoundエラーは超えられたみたい。でもまだエラー出てる。

Unable to load annotation processing manager org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager from classpath.

aptパッケージ自体が、org.eclipse.jdt.core_3.13.102.v20180330-0919.jarに入っていないよう。

今回の設定だと、スルーしてくれずビルドフェイルになっているよう。

参考

https://bugs.eclipse.org/bugs/show_bug.cgi?id=478427

EclipseからJarコピーアンドペーストして使っていたけど、aptパッケージがないので、ecj.jarを使おう。

https://mvnrepository.com/artifact/org.eclipse.jdt.core.compiler/ecj/4.6.1

このjarにはaptパッケージがあった。

とりあえず、ecj.jarをant-libにコピーしたら

masa@em-p:~/Downloads/jaydle-project-clean_antbuild$ ant Compile 
Buildfile: /home/masa/Downloads/jaydle-project-clean_antbuild/build.xml

Initialize:
[delete] Deleting directory /home/masa/Downloads/jaydle-project-clean_antbuild/bin
[delete] Deleting directory /home/masa/Downloads/jaydle-project-clean_antbuild/jar
[mkdir] Created dir: /home/masa/Downloads/jaydle-project-clean_antbuild/bin
[mkdir] Created dir: /home/masa/Downloads/jaydle-project-clean_antbuild/jar

Compile:
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] Compiling 6 source files to /home/masa/Downloads/jaydle-project-clean_antbuild/bin
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] ----------
[javac] 1. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Id3Tagger.java (at line 3)
[javac] import java.util.ArrayList;
[javac] ^^^^^^^^^^^^^^^^^^^
[javac] The import java.util.ArrayList is never used
[javac] ----------
[javac] 2. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Id3Tagger.java (at line 5)
[javac] import java.util.List;
[javac] ^^^^^^^^^^^^^^
[javac] The import java.util.List is never used
[javac] ----------
[javac] 3. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Id3Tagger.java (at line 22)
[javac] import static jaydle.BackgroundTask.*;
[javac] ^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.BackgroundTask is never used
[javac] ----------
[javac] 4. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Id3Tagger.java (at line 25)
[javac] public class Id3Tagger extends JFrame
[javac] ^^^^^^^^^
[javac] The serializable class Id3Tagger does not declare a static final serialVersionUID field of type long
[javac] ----------
[javac] 5. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Id3Tagger.java (at line 32)
[javac] private boolean DEBUG = true; 
[javac] ^^^^^
[javac] The value of the field Id3Tagger.DEBUG is not used
[javac] ----------
[javac] 6. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Id3Tagger.java (at line 49)
[javac] Matcher matcher=pattern.matcher(TargetText);
[javac] ^^^^^^^
[javac] The value of the local variable matcher is not used
[javac] ----------
[javac] ----------
[javac] 7. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 7)
[javac] import java.util.ArrayList;
[javac] ^^^^^^^^^^^^^^^^^^^
[javac] The import java.util.ArrayList is never used
[javac] ----------
[javac] 8. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 8)
[javac] import java.util.Arrays;
[javac] ^^^^^^^^^^^^^^^^
[javac] The import java.util.Arrays is never used
[javac] ----------
[javac] 9. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 10)
[javac] import java.util.regex.Matcher;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import java.util.regex.Matcher is never used
[javac] ----------
[javac] 10. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 11)
[javac] import java.util.regex.Pattern;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import java.util.regex.Pattern is never used
[javac] ----------
[javac] 11. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 14)
[javac] import com.mpatric.mp3agic.ID3v2;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import com.mpatric.mp3agic.ID3v2 is never used
[javac] ----------
[javac] 12. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 15)
[javac] import com.mpatric.mp3agic.Mp3File;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import com.mpatric.mp3agic.Mp3File is never used
[javac] ----------
[javac] 13. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 17)
[javac] import jaydle.JaydlePrototype.ButtonListener;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.JaydlePrototype.ButtonListener is never used
[javac] ----------
[javac] 14. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 21)
[javac] import static jaydle.BackgroundTask.*;
[javac] ^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.BackgroundTask is never used
[javac] ----------
[javac] 15. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydleMusicManager.java (at line 47)
[javac] private boolean DEBUG = true; 
[javac] ^^^^^
[javac] The value of the field JaydleMusicManager.DEBUG is not used
[javac] ----------
[javac] ----------
[javac] 16. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydlePrototype.java (at line 31)
[javac] public class JaydlePrototype extends JFrame 
[javac] ^^^^^^^^^^^^^^^
[javac] The serializable class JaydlePrototype does not declare a static final serialVersionUID field of type long
[javac] ----------
[javac] 17. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/JaydlePrototype.java (at line 119)
[javac] public static class saveDirClass implements Serializable // Named as serObj instance 
[javac] ^^^^^^^^^^^^
[javac] The serializable class saveDirClass does not declare a static final serialVersionUID field of type long
[javac] ----------
[javac] ----------
[javac] 18. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Main.java (at line 4)
[javac] import static jaydle.JaydlePrototype.*;
[javac] ^^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.JaydlePrototype is never used
[javac] ----------
[javac] 19. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Main.java (at line 5)
[javac] import static jaydle.BackgroundTask.*;
[javac] ^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.BackgroundTask is never used
[javac] ----------
[javac] ----------
[javac] 20. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Utilities.java (at line 2)
[javac] import static jaydle.Utilities.println;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.Utilities.println is never used
[javac] ----------
[javac] 21. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Utilities.java (at line 3)
[javac] import static jaydle.Utilities.regexFilterFileArray;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.Utilities.regexFilterFileArray is never used
[javac] ----------
[javac] 22. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Utilities.java (at line 4)
[javac] import static jaydle.Utilities.regexFilterList;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import jaydle.Utilities.regexFilterList is never used
[javac] ----------
[javac] 23. WARNING in /home/masa/Downloads/jaydle-project-clean_antbuild/src/jaydle/Utilities.java (at line 134)
[javac] ObjectInputStream ois = new ObjectInputStream(fis);
[javac] ^^^
[javac] Resource leak: 'ois' is never closed
[javac] ----------
[javac] 23 problems (23 warnings)

BUILD SUCCESSFUL
Total time: 1 second

成功した!

ちなみに、Eclipseのjarコピーしていた時は、jdtCompilerAdapter.jarをjarからコピーして、ant-lib直下に置いていたけど、ecj.jarを使えば、ecj.jarだけで通るみたい。

コンパイルとJarの作成はうまくいったけど、JMMで実行時エラーでてるな。実行時じゃなくてClassNotFoundExceptionだな。

 [java] Exception in thread "main" java.lang.NoClassDefFoundError: com/mpatric/mp3agic/Mp3File
[java] at jaydle.Utilities.makeMp3TagTable3Rows(Utilities.java:287)
[java] at jaydle.JaydleMusicManager.initTable(JaydleMusicManager.java:73)
[java] at jaydle.JaydleMusicManager.main(JaydleMusicManager.java:171)
[java] Caused by: java.lang.ClassNotFoundException: com.mpatric.mp3agic.Mp3File
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] ... 3 more

 

Eclipseエラーメモ 実行エラーとAntのビルドエラー

久しぶりにUbuntuのEclipse使ったら、プロジェクトに赤いビックリマーク付いているものばかりで、プログラムが走らない。

Error: Could not find or load main class org.eclipsebook.ch05.Ch05_02

というエラーでる。

Screenshot from 2019-05-21 21-25-10

しかもコンソールも表示できなくなっていたし。そっちはこちらに書いた。

このビックリマークの意味なんなんだろう。

このlaunchファイル消すのためしたけど、効果なかった。

なんかWorkspace、ごちゃごちゃしている。

 

ビックリマークの意味調べてみた。

参考サイト

http://higehige0.blog.fc2.com/blog-entry-16.html?sp

どうやら、jarが見つからなかったようだ。

プロジェクトを右クリック、ビルドパスから設定して直った。

resourceフォルダに依存jarを入れていて、それをsrcディレクトリに入れていたのが原因だったよう。

それをプロジェクト直下に置いたら、見つけられるようになった。

 

今度はAntのビルドが通らない。

Buildfile: /home/masa/Public/git/jaydle-project/build.xml
Initialize:
   [delete] Deleting directory /home/masa/Public/git/jaydle-project/bin
   [delete] Deleting directory /home/masa/Public/git/jaydle-project/jar
    [mkdir] Created dir: /home/masa/Public/git/jaydle-project/bin
    [mkdir] Created dir: /home/masa/Public/git/jaydle-project/jar
Compile:
    [javac] Since compiler setting isn't classic or modern, ignoring fork setting.

BUILD FAILED
/home/masa/Public/git/jaydle-project/build.xml:43: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter

Total time: 233 milliseconds

前は通ったと思うんだけどな。

いろいろ格闘した結果、できた。

参考サイト

http://tech.cm55.com/wiki/ant/Eclipse

外部ツールから”「JRE」タブにて「ワークスペースと同じJREで実行」を選択する。”ということでした。

たしかに前もこれやったのにな。

ant用のかな、ランのアイコンの中では一番右のものを右クリックで、External Tools Configurations

絶対前もやったよ。

Buildfile: /home/masa/Public/git/jaydle-project/build.xml

Initialize:
      [delete] Deleting directory /home/masa/Public/git/jaydle-project/bin
      [delete] Deleting directory /home/masa/Public/git/jaydle-project/jar
       [mkdir] Created dir: /home/masa/Public/git/jaydle-project/bin
       [mkdir] Created dir: /home/masa/Public/git/jaydle-project/jar

Compile:
       [javac] Since compiler setting isn't classic or modern, ignoring fork setting.
       [javac] Since compiler setting isn't classic or modern, ignoring fork setting.
       [javac] Compiling 6 source files to /home/masa/Public/git/jaydle-project/bin
       [javac] Since compiler setting isn't classic or modern, ignoring fork setting.
       [javac] ----------
       [javac] 1. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java (at line 3)
       [javac] 	import java.util.ArrayList;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^
       [javac] The import java.util.ArrayList is never used
       [javac] ----------
       [javac] 2. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java (at line 5)
       [javac] 	import java.util.List;
       [javac] 	       ^^^^^^^^^^^^^^
       [javac] The import java.util.List is never used
       [javac] ----------
       [javac] 3. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java (at line 22)
       [javac] 	import static jaydle.BackgroundTask.*;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.BackgroundTask is never used
       [javac] ----------
       [javac] 4. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java (at line 25)
       [javac] 	public class Id3Tagger extends JFrame
       [javac] 	             ^^^^^^^^^
       [javac] The serializable class Id3Tagger does not declare a static final serialVersionUID field of type long
       [javac] ----------
       [javac] 5. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java (at line 32)
       [javac] 	private boolean DEBUG = true;	
       [javac] 	                ^^^^^
       [javac] The value of the field Id3Tagger.DEBUG is not used
       [javac] ----------
       [javac] 6. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java (at line 49)
       [javac] 	Matcher matcher=pattern.matcher(TargetText);
       [javac] 	        ^^^^^^^
       [javac] The value of the local variable matcher is not used
       [javac] ----------
       [javac] ----------
       [javac] 7. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 7)
       [javac] 	import java.util.ArrayList;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^
       [javac] The import java.util.ArrayList is never used
       [javac] ----------
       [javac] 8. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 8)
       [javac] 	import java.util.Arrays;
       [javac] 	       ^^^^^^^^^^^^^^^^
       [javac] The import java.util.Arrays is never used
       [javac] ----------
       [javac] 9. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 10)
       [javac] 	import java.util.regex.Matcher;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import java.util.regex.Matcher is never used
       [javac] ----------
       [javac] 10. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 11)
       [javac] 	import java.util.regex.Pattern;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import java.util.regex.Pattern is never used
       [javac] ----------
       [javac] 11. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 14)
       [javac] 	import com.mpatric.mp3agic.ID3v2;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import com.mpatric.mp3agic.ID3v2 is never used
       [javac] ----------
       [javac] 12. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 15)
       [javac] 	import com.mpatric.mp3agic.Mp3File;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import com.mpatric.mp3agic.Mp3File is never used
       [javac] ----------
       [javac] 13. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 17)
       [javac] 	import jaydle.JaydlePrototype.ButtonListener;
       [javac] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.JaydlePrototype.ButtonListener is never used
       [javac] ----------
       [javac] 14. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 21)
       [javac] 	import static jaydle.BackgroundTask.*;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.BackgroundTask is never used
       [javac] ----------
       [javac] 15. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java (at line 47)
       [javac] 	private boolean DEBUG = true;	
       [javac] 	                ^^^^^
       [javac] The value of the field JaydleMusicManager.DEBUG is not used
       [javac] ----------
       [javac] ----------
       [javac] 16. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java (at line 31)
       [javac] 	public class JaydlePrototype extends JFrame 
       [javac] 	             ^^^^^^^^^^^^^^^
       [javac] The serializable class JaydlePrototype does not declare a static final serialVersionUID field of type long
       [javac] ----------
       [javac] 17. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java (at line 119)
       [javac] 	public static class saveDirClass implements Serializable // Named as serObj instance  
       [javac] 	                    ^^^^^^^^^^^^
       [javac] The serializable class saveDirClass does not declare a static final serialVersionUID field of type long
       [javac] ----------
       [javac] ----------
       [javac] 18. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Main.java (at line 4)
       [javac] 	import static jaydle.JaydlePrototype.*;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.JaydlePrototype is never used
       [javac] ----------
       [javac] 19. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Main.java (at line 5)
       [javac] 	import static jaydle.BackgroundTask.*;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.BackgroundTask is never used
       [javac] ----------
       [javac] ----------
       [javac] 20. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java (at line 2)
       [javac] 	import static jaydle.Utilities.println;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.Utilities.println is never used
       [javac] ----------
       [javac] 21. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java (at line 3)
       [javac] 	import static jaydle.Utilities.regexFilterFileArray;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.Utilities.regexFilterFileArray is never used
       [javac] ----------
       [javac] 22. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java (at line 4)
       [javac] 	import static jaydle.Utilities.regexFilterList;
       [javac] 	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [javac] The import jaydle.Utilities.regexFilterList is never used
       [javac] ----------
       [javac] 23. WARNING in /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java (at line 134)
       [javac] 	ObjectInputStream ois = new ObjectInputStream(fis);
       [javac] 	                  ^^^
       [javac] Resource leak: 'ois' is never closed
       [javac] ----------
       [javac] 23 problems (23 warnings)

MakeJar:
         [jar] Building jar: /home/masa/Public/git/jaydle-project/jar/Jaydle.jar
         [jar] Building jar: /home/masa/Public/git/jaydle-project/jar/JaydleMusicManager.jar

Run:
        [java] Return of serObj.getPath().toString() /home/masa/ydlAudio
        [java] -- listing properties --
        [java] java.runtime.name=OpenJDK Runtime Environment
        [java] sun.boot.library.path=/usr/lib/jvm/java-8-openjdk-amd64/jre...
        [java] java.vm.version=25.212-b03
        [java] java.vm.vendor=Oracle Corporation
        [java] java.vendor.url=http://java.oracle.com/
        [java] path.separator=:
        [java] java.vm.name=OpenJDK 64-Bit Server VM
        [java] file.encoding.pkg=sun.io
        [java] user.country=US
        [java] sun.java.launcher=SUN_STANDARD
        [java] sun.os.patch.level=unknown
        [java] java.vm.specification.name=Java Virtual Machine Specification
        [java] user.dir=/home/masa/Public/git/jaydle-project
        [java] java.runtime.version=1.8.0_212-8u212-b03-0ubuntu1.16.04.1-b03
        [java] java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
        [java] java.endorsed.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre...
        [java] os.arch=amd64
        [java] java.io.tmpdir=/tmp
        [java] line.separator=
        [java] java.vm.specification.vendor=Oracle Corporation
        [java] os.name=Linux
        [java] sun.jnu.encoding=UTF-8
        [java] java.library.path=/usr/java/packages/lib/amd64:/usr/lib...
        [java] sun.awt.enableExtraMouseButtons=true
        [java] java.specification.name=Java Platform API Specification
        [java] java.class.version=52.0
        [java] sun.management.compiler=HotSpot 64-Bit Tiered Compilers
        [java] os.version=4.4.0-145-lowlatency
        [java] user.home=/home/masa
        [java] user.timezone=
        [java] java.awt.printerjob=sun.print.PSPrinterJob
        [java] file.encoding=UTF-8
        [java] java.specification.version=1.8
        [java] user.name=masa
        [java] java.class.path=/home/masa/Public/git/jaydle-project/...
        [java] java.vm.specification.version=1.8
        [java] sun.arch.data.model=64
        [java] java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre
        [java] sun.java.command=/home/masa/Public/git/jaydle-project/...
        [java] java.specification.vendor=Oracle Corporation
        [java] user.language=en
        [java] awt.toolkit=sun.awt.X11.XToolkit
        [java] java.vm.info=mixed mode
        [java] java.version=1.8.0_212
        [java] java.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre...
        [java] sun.boot.class.path=/usr/lib/jvm/java-8-openjdk-amd64/jre...
        [java] java.vendor=Oracle Corporation
        [java] file.separator=/
        [java] java.vendor.url.bug=http://bugreport.sun.com/bugreport/
        [java] sun.cpu.endian=little
        [java] sun.io.unicode.encoding=UnicodeLittle
        [java] sun.font.fontmanager=sun.awt.X11FontManager
        [java] sun.desktop=gnome
        [java] sun.cpu.isalist=
        [java] Exception in thread "main" java.lang.NullPointerExceptionException caughtjava.lang.NullPointerException
        [java] 	at jaydle.JaydleMusicManager.printDoubleDimentionArray(JaydleMusicManager.java:97)
        [java] 	at jaydle.JaydleMusicManager.initTable(JaydleMusicManager.java:74)
        [java] 	at jaydle.JaydleMusicManager.main(JaydleMusicManager.java:171)

すごい数の警告でてる。

でも、コンパイルとJar作成と実行ができてる!!!

 

javac Java Compiler Memo

-d option defines generated class file path

-d classpath sourcefile

Met errors.

  • Permission error of external jar files -> change permission from eclipse file property
  • javac: invalid flag:error -> quotation solved this (when I used wild * card)

 

collect statement for compile eclipse project programs

javac -d /home/masa/Desktop/build-test -cp src/jaydle/*;resources/mp3agic-0.9.2-SNAPSHOT.jar;resources/jid3lib-0.6.1-SNAPSHOT.jar src/jaydle/Utilities.java

this case -cp ./ was not collect.

But still generating same errors to this post

https://lavilleeternelle.wordpress.com/2019/02/21/memo-about-ant/

 

 

Memo about ant

https://ant.apache.org/manual-1.9.x/index.html

A project has 3 attributes:

  1. name
  2. default
  3. basedir

Target : tasks you wanted to be executed : 実行されたいと思ったタスクの集まり

Run Ant Build Alt Shift X, Q Op Com X, Q (Mac)

Below, dependent library classpath error.

Buildfile: /home/masa/Public/git/jaydle-project/build.xml
Initialize:
[delete] Deleting directory /home/masa/Public/git/jaydle-project/bin
[delete] Deleting directory /home/masa/Public/git/jaydle-project/jar
[mkdir] Created dir: /home/masa/Public/git/jaydle-project/bin
[mkdir] Created dir: /home/masa/Public/git/jaydle-project/jar
Compile:
[javac] /home/masa/Public/git/jaydle-project/build.xml:23: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 6 source files to /home/masa/Public/git/jaydle-project/bin
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:279: error: cannot find symbol
[javac] class MenuListenerListMp3Files implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:260: error: cannot find symbol
[javac] class MenuListenerListDirectory implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:240: error: cannot find symbol
[javac] class MenuListenerClearDisplay implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:221: error: cannot find symbol
[javac] class MenuListenerDisplayCurrentDir implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:182: error: cannot find symbol
[javac] class MenuListenerSaveDir implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:163: error: cannot find symbol
[javac] class ButtonListener implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:147: error: cannot find symbol
[javac] public static class saveDirClass implements Serializable // Named as serObj instance 
[javac] ^
[javac] symbol: class Serializable
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:49: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.ID3v2;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:50: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.Mp3File;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:14: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.ID3v2;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:15: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.Mp3File;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java:15: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.ID3v2;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java:16: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.Mp3File;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java:14: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.ID3v2;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydleMusicManager.java:15: error: package com.mpatric.mp3agic does not exist
[javac] import com.mpatric.mp3agic.Mp3File;
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:124: error: incompatible types: JaydlePrototype.MenuListenerSaveDir cannot be converted to ActionListener
[javac] menuItem1.addActionListener(new MenuListenerSaveDir());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:125: error: incompatible types: JaydlePrototype.MenuListenerDisplayCurrentDir cannot be converted to ActionListener
[javac] menuItem2Display.addActionListener(new MenuListenerDisplayCurrentDir());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:126: error: incompatible types: JaydlePrototype.MenuListenerClearDisplay cannot be converted to ActionListener
[javac] menuItem3ClearDisplay.addActionListener(new MenuListenerClearDisplay());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:127: error: incompatible types: JaydlePrototype.MenuListenerListDirectory cannot be converted to ActionListener
[javac] menuItem4ListDirectory.addActionListener(new MenuListenerListDirectory());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:128: error: incompatible types: JaydlePrototype.MenuListenerListMp3Files cannot be converted to ActionListener
[javac] menuItem5ListMp3Files.addActionListener(new MenuListenerListMp3Files());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:134: error: incompatible types: JaydlePrototype.ButtonListener cannot be converted to ActionListener
[javac] button.addActionListener(new ButtonListener()); 
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:201: error: incompatible types: saveDirClass cannot be converted to Serializable
[javac] store(serObj, jaydleSerFile);
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:287: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:287: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:288: error: cannot find symbol
[javac] ID3v2 v2Tag=mp3file.getId3v2Tag();
[javac] ^
[javac] symbol: class ID3v2
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:332: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:332: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:333: error: cannot find symbol
[javac] ID3v2 v2Tag=mp3file.getId3v2Tag();
[javac] ^
[javac] symbol: class ID3v2
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:379: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:379: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:380: error: cannot find symbol
[javac] ID3v2 v2Tag=mp3file.getId3v2Tag();
[javac] ^
[javac] symbol: class ID3v2
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:446: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:446: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(mp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Utilities.java:447: error: cannot find symbol
[javac] ID3v2 v2Tag=mp3file.getId3v2Tag();
[javac] ^
[javac] symbol: class ID3v2
[javac] location: class Utilities
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java:99: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(fileMp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Id3Tagger
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java:99: error: cannot find symbol
[javac] Mp3File mp3file=new Mp3File(fileMp3); 
[javac] ^
[javac] symbol: class Mp3File
[javac] location: class Id3Tagger
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/Id3Tagger.java:100: error: cannot find symbol
[javac] ID3v2 v2Tag=mp3file.getId3v2Tag();
[javac] ^
[javac] symbol: class ID3v2
[javac] location: class Id3Tagger
[javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
[javac] 37 errors

BUILD FAILED
/home/masa/Public/git/jaydle-project/build.xml:23: Compile failed; see the compiler error output for details.

Total time: 1 second

Next time no external jar import errrors.

My class dependent error??

Buildfile: /home/masa/Public/git/jaydle-project/build.xml
Initialize:
[delete] Deleting directory /home/masa/Public/git/jaydle-project/bin
[delete] Deleting directory /home/masa/Public/git/jaydle-project/jar
[mkdir] Created dir: /home/masa/Public/git/jaydle-project/bin
[mkdir] Created dir: /home/masa/Public/git/jaydle-project/jar
Compile:
[javac] /home/masa/Public/git/jaydle-project/build.xml:27: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 6 source files to /home/masa/Public/git/jaydle-project/bin
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:279: error: cannot find symbol
[javac] class MenuListenerListMp3Files implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:260: error: cannot find symbol
[javac] class MenuListenerListDirectory implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:240: error: cannot find symbol
[javac] class MenuListenerClearDisplay implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:221: error: cannot find symbol
[javac] class MenuListenerDisplayCurrentDir implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:182: error: cannot find symbol
[javac] class MenuListenerSaveDir implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:163: error: cannot find symbol
[javac] class ButtonListener implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:147: error: cannot find symbol
[javac] public static class saveDirClass implements Serializable // Named as serObj instance 
[javac] ^
[javac] symbol: class Serializable
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:124: error: incompatible types: JaydlePrototype.MenuListenerSaveDir cannot be converted to ActionListener
[javac] menuItem1.addActionListener(new MenuListenerSaveDir());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:125: error: incompatible types: JaydlePrototype.MenuListenerDisplayCurrentDir cannot be converted to ActionListener
[javac] menuItem2Display.addActionListener(new MenuListenerDisplayCurrentDir());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:126: error: incompatible types: JaydlePrototype.MenuListenerClearDisplay cannot be converted to ActionListener
[javac] menuItem3ClearDisplay.addActionListener(new MenuListenerClearDisplay());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:127: error: incompatible types: JaydlePrototype.MenuListenerListDirectory cannot be converted to ActionListener
[javac] menuItem4ListDirectory.addActionListener(new MenuListenerListDirectory());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:128: error: incompatible types: JaydlePrototype.MenuListenerListMp3Files cannot be converted to ActionListener
[javac] menuItem5ListMp3Files.addActionListener(new MenuListenerListMp3Files());
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:134: error: incompatible types: JaydlePrototype.ButtonListener cannot be converted to ActionListener
[javac] button.addActionListener(new ButtonListener()); 
[javac] ^
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:201: error: incompatible types: saveDirClass cannot be converted to Serializable
[javac] store(serObj, jaydleSerFile);
[javac] ^
[javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
[javac] 14 errors

BUILD FAILED
/home/masa/Public/git/jaydle-project/build.xml:27: Compile failed; see the compiler error output for details.

Total time: 879 milliseconds
<?xml version="1.0" encoding="UTF-8" ?>
<project name="jaydle-project" basedir="." default="Main Build">
<property name="bin" location="bin"/>
<property name="src" location="src"/>
<property name="resources" location="resources"/>
<property name="jardir" location="jar"/>
<property name="jarjaydledl" location="${jardir}/JaydleDownloader.jar"/>
<property name="jarjaydlemm" location="${jardir}/JaydleMusicManager.jar"/>
<property name="main-class" location=""/>

<path id="classpath">
<fileset dir="${resources}" includes="**/*.jar"/>
</path>

<target name = "Main Build" depends="Initialize,Compile">
<echo message = "Ant at work!" />
</target>

<target name="Initialize">
<delete dir="${bin}"/>
<delete dir="${jardir}"/>
<mkdir dir="${bin}"/>
<mkdir dir="${jardir}"/>
</target>

<target name="Compile" depends="Initialize">
<javac srcdir="${src}" destdir="${bin}" classpathref="classpath">
</javac>
</target>


</project>

This script wasn’t enough.

maybe classpath problem.

compile error cause of dependency class files.

[javac]warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

Add

<javac srcdir=”${src}” destdir=”${bin}” classpathref=”classpath” includeantruntime=”false>

solve this.

Below is a main error

error: cannot find symbol

 

Next

Error: Could not find or load main class jaydle.Main

occurred. This time Project > Clean solved this.

https://lavilleeternelle.wordpress.com/2018/09/21/eclipse%e3%81%aerun-configration%e3%81%ae%e3%83%90%e3%82%b0%e5%8f%96%e3%82%8a/

deleting launch configure files aren’t effective.

It seems my ant build.xml file collapsing the project file or classpath file.

This is being cause of this error.

When I checked .classpath file when Error: Could not find or load main class occurred,

lib, resource around naming is the cause.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="jaydle-project" basedir="." default="Main Build">
<property name="bin" location="bin"/>
<property name="src" location="src"/>
<property name="srcdir" location="${src}/jaydle"/>
<property name="resources" location="resources"/>
<property name="jardir" location="jar"/>
<property name="jarjaydledl" location="${jardir}/JaydleDownloader.jar"/>
<property name="jarjaydlemm" location="${jardir}/JaydleMusicManager.jar"/>
<property name="main-class" location="Main"/>

<path id="classpath">
<fileset dir="${resources}" includes="**/*.jar"/>
</path>

<target name = "Main Build" depends="Initialize,Compile">
<echo message = "Ant at work!" />
</target>

<target name="Initialize">
<delete dir="${bin}"/>
<delete dir="${jardir}"/>
<mkdir dir="${bin}"/>
<mkdir dir="${jardir}"/>
</target>

<target name="Compile" depends="Initialize">
<javac 
classpathref="classpath" 
srcdir="${src}" 
destdir="${bin}" 
includeantruntime="false"
source="1.8"
target="1.8"
fork="true" 
debug="true" 
>
</javac>
</target>


</project>

 

Realized it’s all about java.awt.Event.ActionListener

eclipse compiler error output -> show view -> problems
This wasn’t useful.
How to see compiler error output??
And how to recompile with -Xdiags:verbose to get full output?

Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output

from
https://stackoverflow.com/questions/4597968/how-to-recompile-with-xlintunchecked-in-ant-build-task

<compilerarg value="-Xdiags:verbose"/>

It worked but no clue to solve

Buildfile: /home/masa/Public/git/jaydle-project/build.xml
Initialize:
[delete] Deleting directory /home/masa/Public/git/jaydle-project/bin
[delete] Deleting directory /home/masa/Public/git/jaydle-project/jar
[mkdir] Created dir: /home/masa/Public/git/jaydle-project/bin
[mkdir] Created dir: /home/masa/Public/git/jaydle-project/jar
Compile:
[javac] Compiling 6 source files to /home/masa/Public/git/jaydle-project/bin
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:280: error: cannot find symbol
[javac] class MenuListenerListMp3Files implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:261: error: cannot find symbol
[javac] class MenuListenerListDirectory implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:241: error: cannot find symbol
[javac] class MenuListenerClearDisplay implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:222: error: cannot find symbol
[javac] class MenuListenerDisplayCurrentDir implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:183: error: cannot find symbol
[javac] class MenuListenerSaveDir implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:164: error: cannot find symbol
[javac] class ButtonListener implements ActionListener
[javac] ^
[javac] symbol: class ActionListener
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:148: error: cannot find symbol
[javac] public static class saveDirClass implements Serializable // Named as serObj instance 
[javac] ^
[javac] symbol: class Serializable
[javac] location: class JaydlePrototype
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:125: error: method addActionListener in class AbstractButton cannot be applied to given types;
[javac] menuItem1.addActionListener(new MenuListenerSaveDir());
[javac] ^
[javac] required: ActionListener
[javac] found: JaydlePrototype.MenuListenerSaveDir
[javac] reason: argument mismatch; JaydlePrototype.MenuListenerSaveDir cannot be converted to ActionListener
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:126: error: method addActionListener in class AbstractButton cannot be applied to given types;
[javac] menuItem2Display.addActionListener(new MenuListenerDisplayCurrentDir());
[javac] ^
[javac] required: ActionListener
[javac] found: JaydlePrototype.MenuListenerDisplayCurrentDir
[javac] reason: argument mismatch; JaydlePrototype.MenuListenerDisplayCurrentDir cannot be converted to ActionListener
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:127: error: method addActionListener in class AbstractButton cannot be applied to given types;
[javac] menuItem3ClearDisplay.addActionListener(new MenuListenerClearDisplay());
[javac] ^
[javac] required: ActionListener
[javac] found: JaydlePrototype.MenuListenerClearDisplay
[javac] reason: argument mismatch; JaydlePrototype.MenuListenerClearDisplay cannot be converted to ActionListener
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:128: error: method addActionListener in class AbstractButton cannot be applied to given types;
[javac] menuItem4ListDirectory.addActionListener(new MenuListenerListDirectory());
[javac] ^
[javac] required: ActionListener
[javac] found: JaydlePrototype.MenuListenerListDirectory
[javac] reason: argument mismatch; JaydlePrototype.MenuListenerListDirectory cannot be converted to ActionListener
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:129: error: method addActionListener in class AbstractButton cannot be applied to given types;
[javac] menuItem5ListMp3Files.addActionListener(new MenuListenerListMp3Files());
[javac] ^
[javac] required: ActionListener
[javac] found: JaydlePrototype.MenuListenerListMp3Files
[javac] reason: argument mismatch; JaydlePrototype.MenuListenerListMp3Files cannot be converted to ActionListener
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:135: error: method addActionListener in class AbstractButton cannot be applied to given types;
[javac] button.addActionListener(new ButtonListener()); 
[javac] ^
[javac] required: ActionListener
[javac] found: JaydlePrototype.ButtonListener
[javac] reason: argument mismatch; JaydlePrototype.ButtonListener cannot be converted to ActionListener
[javac] /home/masa/Public/git/jaydle-project/src/jaydle/JaydlePrototype.java:202: error: method store in class Utilities cannot be applied to given types;
[javac] store(serObj, jaydleSerFile);
[javac] ^
[javac] required: Serializable,File
[javac] found: saveDirClass,File
[javac] reason: argument mismatch; saveDirClass cannot be converted to Serializable
[javac] 14 errors

BUILD FAILED
/home/masa/Public/git/jaydle-project/build.xml:38: Compile failed; see the compiler error output for details.

Total time: 1 second

It’s all
src/jaydle/JaydlePrototype.java and
“cannot find symbol” and “incompatible types” errors.

 

error: cannot find symbol
[javac] class MenuListenerSaveDir implements ActionListener

error: incompatible types: JaydlePrototype.MenuListenerSaveDir cannot be converted to ActionListener
[javac] menuItem1.addActionListener(new MenuListenerSaveDir());

 

After this, I tried other projects, and had no problems so maybe import statements errors.

I’m trying to write my java build program.

But it also spitting errors…

https://lavilleeternelle.wordpress.com/?p=791

Jaydle journal

  1. Bash scripts to Java processbuilder program migration.
  2. Add jmenubar and add action (used inner class)
  3. Implemented JFileChooser
  4. Implemented swingworker class doinbackground
  5. Object serialization to store save directory data
  6. Used system property variables for default save directory
  7. Initialize .ser file to store data.
  8. ID3Tag viewer implementation, using mpatric mp3agic
  9. Used jtable to display id3 tags
  10. Windows YouTube-dl execution program write but it needs ffmpeg to extract audio, this is not done
  11. Wrote JaydleMusicManager which can handle MP3 files ID3 tags and move other directory
  12. Put in order eclipse project file (not pushed to GitHub yet)