Javaのコンパイル・Jarの作成・Antなどのビルドツール・Eclipseのビルド まとめ

AntでEclipseで作ったプロジェクトのビルドファイルを書いていて、いままでのビルド系の記事をまとめて見ることにした。

自分は実行可能JarをAntで作っていて、依存ライブラリのコピーが必要なことを忘れていた。

 

Advertisements

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)

JavaSound教科書 赤間世紀著: メモ

最初のサンプルプログラム2個ちゃんと動作してないのなんでだろ。

clip使ったプログラム、音源が最後まで再生されない。

レコーダーは動いたけど。

サポートページに載っているかな。。。

その後

動くよう修正した。

masa – masa – Clip01としてワークスペースに保存

getFrameLength()とgetMicrosecondLength()を試した。

最後まで流すのにgetMicrosecondLengthの返り値を使った。適切に繰り上げしないとなぁ。

Starting Android Programming: Android Studio Run Configuration Error

androidprog.jpg

Gotta this error message from Android Studio when started android programming for the first time.

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103) at org.gradle.api.internal.

From the solvent start, set proper path of JDK was effective.
I also downloaded other SDK version for each Android version.

 

Other error message.

Edit Configuration: Error Please select Android SDK

I Logged in to Google Account

Installed many SDK versions and Tools from SDK Manager icon on Android Studio.

Right upper icon on Android Studio – Project settings (icon) > change JDK to /usr/lib/jvm/1.8

I guess my case was cause of JVM path.
Perhaps SDK was only latest one, I downloaded even the oldest one.
It expanded to 11.9GB…

Screenshot from 2018-12-05 12-58-07.jpg

Solved this !!!

 

Next execute on my tablet.
http://cg.hatenadiary.jp/entry/2015/01/02/185636

My Ubuntu didn’t recognize my tablet.

installed adb

make sure the tablet’s

developer options > usb debugging on

Use sudo usermod -aG plugdev $LOGNAME to add yourself to the plugdev group about adb command.

cd to ..

masa@em-p:~/Android/Sdk/platform-tools$ ./adb devices
List of devices attached
adb server version (32) doesn’t match this client (40); killing…
* daemon started successfully

Changed cable.
restart tablet and ubuntu resolved this.
Often usb debugging mode is don’t know why..

androidProg2

Jaydle Development Journal:JA(va) Y(outube)D(l)-E(xtended)

I’m going to make post about note of jaydle development.
This is program which enhance youtube-dl command.

First I made prototype in bash.

It can download simultaneously and can download by just search keywords.
E.G

“jaydle -keywords tsunami disasters”

will downloads result videos top 10 automatically.
And I have numbering option from the top search result.
So you can know the order of search result after downloading.

But this shell script needing edit somehow. LoL.

I’m planning to make public journal of Jaydle development. e.g. Implementing SwingWorker, Menu bar, Serialization of the store path, …

So watching me!!!

Windows Administrating: Install OpenJDK 1.8

To begin from the result had to uninstall old Oracle jdk (1.6) to use Openjdk 1.8 because of priority problem I guess. But it made can’t open jar file by double click the file…

So if you will, take responsibillity…

Today I installed Eclipse Oxygen to clean installed Windows 7 on NEC LaVie laptop which I call “dee-jay” because this is for Traktor DJ.

And when lauching Eclipse it said like “Need newer JDK than 1.6”.
So I downloaded the source from here.
https://jdk.java.net/java-se-ri/8

Here I heard “Windows i586” for the first time.
But it was not problem so. Just CPU architecture (guess old).

After downloaded the zip extracted to “Program Files” directory.
And added the path to “Environmental Variables”.
But it kept using 1.6 JDK.
Configuring “JAVA_HOME” environment variable was not effective too.

Finally I uninstalled old “Oracle JDK 1.6” from the “Control Panel” > “Uninstall Softwares”.
This was great. 1.6 jdk was at “System32” directory whereis high priorities.

I used

start — this start programs in the search path.
path — this displays path variable values.
(setx path “%path%; this is useful to set path variable)

commands on Command prompt.

And now fighting to Clone git repository on eclipse LoL.