Ant构建错误。在Eclipse上成功但不使用ant。 “找不到符号”和“类...不能应用于给定类型”错误

问题描述 投票:0回答:1

这个java文件生成如下的ant build错误

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:241: 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:224: 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:206: 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:187: 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:150: 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:133: 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:117: 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:94: 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:95: 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:96: 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:97: 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:98: 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:104: 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:169: 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

源码java代码是

package jaydle;
/*180512(Sat)
 * Youtube-Dl-Extended用のプロセスビルダーを書く
 * 
 */
import java.lang.ProcessBuilder;

import static jaydle.Main.*;
import static jaydle.Utilities.*;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.*;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class JaydlePrototype extends JFrame 
{
     static JFrame frame;
     static JTextArea textOut=new JTextArea();
     static JScrollPane scrollpane=new JScrollPane(
             textOut,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
             JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
     static String initText=("Please input URL");
     static JTextField textIn=new JTextField(initText);
     static JPanel panel =new JPanel();
     static String strIn=null;
     static List<String> cmdList= new ArrayList<>
     (Arrays.asList(
             "youtube-dl",
             "--no-playlist",
             "--extract-audio",
             "--audio-format",
             "mp3",
             "-o",
             "'%(title)s.%(ext)s'"
             ));
     static String url;//="https://www.youtube.com/watch?v=FqVTzr3CfEg";
     static BackgroundTask bgt; //Child class of SwingWorker
     static ProcessBuilder pbNew;
     static File jaydleSerFile=new File("jaydle.ser");
     //Variables for ListMp3Files Method
        static String TargetText;
        static String TargetTextNohead;
        static String TargetTextNoheadNoTail;
        static String patternStr;
        static String patternStrHead;
        static String patternStrTail;
        static String[] TargetTextSplitArray;
        static File file;
        static File fileStore;
        static int n=0;
        //For JTable
        static Object[][] data;
        static Object dataRow[];
        static String[] columnNames= {
                "FileName",
                "Artist",
                "Title",
        };

        public void initGuiApp() 
        {

            JLabel text =new JLabel("\"JAva Youtube-DL Exteded implementation by Masataka Nakamura\"");
            frame = new JFrame("Jaydle");
            JMenuBar menuBar=new JMenuBar();
            JMenu menu1=new JMenu("Store");
            menuBar.add(menu1);
            JMenuItem menuItem1=new JMenuItem("Change save directory");
            JMenuItem menuItem2Display=new JMenuItem("Display current saving directory");
            JMenuItem menuItem3ClearDisplay=new JMenuItem("Clear Display");
            JMenuItem menuItem4ListDirectory=new JMenuItem("List Directory");
            JMenuItem menuItem5ListMp3Files=new JMenuItem("List MP3 Files");
            menu1.add(menuItem1);
            menu1.add(menuItem2Display);
            menu1.add(menuItem3ClearDisplay);
            menu1.add(menuItem4ListDirectory);
            menu1.add(menuItem5ListMp3Files);
            menuItem1.addActionListener(new MenuListenerSaveDir());
            menuItem2Display.addActionListener(new MenuListenerDisplayCurrentDir());
            menuItem3ClearDisplay.addActionListener(new MenuListenerClearDisplay());
            menuItem4ListDirectory.addActionListener(new MenuListenerListDirectory());
            menuItem5ListMp3Files.addActionListener(new MenuListenerListMp3Files());
            frame.setJMenuBar(menuBar);

            textOut.setLineWrap(true);
            JButton button=new JButton("Download");
            button.setPreferredSize(new Dimension(100, 30));
            button.addActionListener(new ButtonListener()); 
            panel.setLayout(new BorderLayout());//このコードがパネルのレイアウト変更には必要
            panel.add(BorderLayout.NORTH,text);//"Youtube-DL Exteded Java Implementation by Masataka Nakamura"
            panel.add(BorderLayout.SOUTH,textIn);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().add(BorderLayout.CENTER,scrollpane);
            frame.getContentPane().add(BorderLayout.NORTH,panel);
            frame.getContentPane().add(BorderLayout.SOUTH,button);
            frame.setSize(800,600);
            frame.setVisible(true);
        }
        //End of init()

     public static class saveDirClass implements Serializable // Named as serObj instance  
     {
          private File saveDirSerializable;

          public void setPath(File path)
          {
              saveDirSerializable=path;
          }

          public File getPath()
          {
              return saveDirSerializable;
          }
     }


    class ButtonListener implements ActionListener
    {
        public void actionPerformed(ActionEvent e)
        {
                strIn=textIn.getText();
                if(strIn.length()>13)
                    url=strIn;
                    cmdListSetter(strIn);
                    printList(cmdList);

                    //dlAudio(strIn);
                bgt=new BackgroundTask();

                    bgt.execute();
        }
    }

    class MenuListenerSaveDir implements ActionListener
    {
        public void actionPerformed(ActionEvent e)
        {
            JFileChooser filechooser=new JFileChooser();
            filechooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            //int retFileChooser=filechooser.showOpenDialog(this);
            //(this)だとエラーになる
            int retFileChooser=filechooser.showOpenDialog(panel);
            //https://www.javadrive.jp/tutorial/jfilechooser/index2.html
            //からコピペ
             if (retFileChooser == JFileChooser.APPROVE_OPTION)
             {
                 saveDirectory = filechooser.getSelectedFile();
                 saveDirString=filechooser.getSelectedFile().toString();
                 serObj.setPath(saveDirectory);
                 try
                 {
                     println("serObj.getPath().toString returns "+serObj.getPath().toString());
                     store(serObj, jaydleSerFile);
                 }
                 catch(IOException ex)
                 {
                     println("IOException, jaydle.ser around wrong...");
                 }
            }
             else if (retFileChooser == JFileChooser.CANCEL_OPTION)
             {
                  //label.setText("キャンセルされました");
                }
             else if (retFileChooser == JFileChooser.ERROR_OPTION)
             {
                  //label.setText("エラー又は取消しがありました");
                }
        }
    }

    class MenuListenerDisplayCurrentDir implements ActionListener
    {
        public void actionPerformed(ActionEvent e)
        {
            println("Display current saving directory clicked!"); 
            try
            {
                //saveDirectory=pbNew.directory();
                    //println("saveDirectory is "+saveDirectory.toString()); This statement made error.
                //saveDirectory.toString(); this also bad.
                    textOut.append(serObj.getPath().toString()+"\n");
            }
            catch(NullPointerException exc){
                println("File type something null pointer.");
                exc.printStackTrace();
            }
        }
    }

    class MenuListenerClearDisplay implements ActionListener
    {
        public void actionPerformed(ActionEvent e)
        {
            println("Clear Display command clicked!"); 
            try
            {
                textOut.selectAll();
                textOut.replaceSelection("");
            }
            catch(NullPointerException exc)
            {
                println("File type something null pointer.");
                exc.printStackTrace();
            }
        }
    }

    class MenuListenerListDirectory implements ActionListener
    {
        public void actionPerformed(ActionEvent e)
        {
            println("List Directory command clicked!"); 
            try
            {
                jls(serObj.getPath().toString());
            }
            catch(NullPointerException exc)
            {
                println("File type something null pointer.");
                exc.printStackTrace();
            }
        }
    }

    class MenuListenerListMp3Files implements ActionListener
    {
        public void actionPerformed(ActionEvent e)
        {
            Id3Tagger gui=new Id3Tagger();
            gui.initGuiId3Tagger();
        }
    }



    static void jls(String file) 
    {
        try 
        {
            File homeDir = new File(file);

            String[] homeDirList=homeDir.list(); //ファイルオブジェクトのリストメソッドをつかう
            //結果をストリングス配列に格納
            Arrays.sort(homeDirList);
            for (String i : homeDirList) 
            {
                if (i.charAt(0) == '.') ;
                else 
                {
                System.out.print(i + ",");
                System.out.println();
                textOut.append(i);
                textOut.append("\n");
                } 
            }
            System.out.println();
        }       
        catch(NullPointerException e) 
        {
            e.printStackTrace(); // IMPORTANT
        }
    }//jlsおわり

    public void printDoubleDimentionArray()
    {
        for(int i=0;i<data.length;i++)
        {
            for(int j=0;j<data[i].length;j++)
            {
                println(data[i][j]);
            }
        }
    }

    public static List<String> toList(String[] strArray)
    {
        try
        {
        //List<String> cmdList=new ArrayList<String>();
        for(String s:strArray)
            {
                cmdList.add(s);
            }
        return cmdList;
        }catch(Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }



    public static void cmdListSetter(String url)
    {
        //String[] audioDl= {"youtube-dl","--no-playlist","--extract-audio","--audio-format","mp3",url,"-o","'%(title)s.%(ext)s'"};
        println("From cmdListGenerator: content of variable url = "+url);
        //cmdList.set(5,url);
        //printList(audioDl);
        cmdList.add(5,url);
    }
}
//end of class ProcessBuild

我是ant的新手但使用ActionListener应用程序检查了另一个并且它成功了。我检查了import语句和googled错误代码,但我找不到案例“Eclipse OK,但不是ant”案例。

还检查了ant build.xml文件但是我觉得好像。

<?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" 
            >
            <compilerarg value="-Xdiags:verbose"/>
            </javac>
    </target>


</project>

为什么蚂蚁抱怨符号和类型?

java eclipse ant build-error
1个回答
0
投票

因为......

Eclipse使用EJC(eclipse Java编译器),它比标准Java编译器更容易编译错误。所以使用ant build脚本中的ejc解决了这个问题。

org.eclipse.jdt.core_xxx.jar
jdtCompilerAdapter.jar

到根项目目录下的ant-lib目录并运行>外部工具>外部工具配置> JRE>在与工作空间相同的JRE中运行

将以下代码添加到build.xml文件中。

<typedef name="ecj" classname="org.eclipse.jdt.core.JDTCompilerAdapter">
     <classpath>
          <fileset dir="ant-lib" includes="*.jar" />
     </classpath>
</typedef>

compiler="org.eclipse.jdt.core.JDTCompilerAdapter"

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

...

执行build.xml ...

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 117)
       [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)

Main Build:
        [echo] Ant at work!
BUILD SUCCESSFUL
Total time: 674 milliseconds

生成警告但建立成功。

但还是要修改到标准的java编译器......

© www.soinside.com 2019 - 2024. All rights reserved.