运行时vlcj.jar的问题

时间:2016-09-08 09:36:25

标签: java netbeans-8 vlcj

我第一次在this tutorial之后测试vlcj,但是当我运行它时,我得到了这个错误输出:

cd C:\Users\abolfazl\Documents\NetBeansProjects\testplayer; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_05" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0\\java\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath com.mycompany.testplayer.InformationLib\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_05\\bin\\java.exe\" -DnetbeansProjectMappings= -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.0\\java\\maven-nblib\\netbeans-eventspy.jar\" org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...

------------------------------------------------------------------------
Building mrbool.vlc.example 0.0.1-SNAPSHOT
------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2/exec-maven-plugin-1.2.pom

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.939s
Finished at: Thu Sep 08 13:49:28 IRDT 2016
Final Memory: 6M/159M
------------------------------------------------------------------------
Failed to execute goal on project mrbool.vlc.example: Could not resolve dependencies for project mrbool.vlc:mrbool.vlc.example:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [uk.co.caprica:vlcj:jar:3.10.1 (compile), org.codehaus.mojo:exec-maven-plugin:jar:1.2 (compile)]: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.2: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.2 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我的InformationLib.java是:

import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import uk.co.caprica.vlcj.runtime.x.LibXUtil;

public class InformationLib {

    public static void main(String[] args) throws Exception {
         System.out.println("aaaaaa");
        NativeLibrary.addSearchPath(
                RuntimeUtil.getLibVlcLibraryName(), "d:/vlc-2.2.1");
        Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
        LibXUtil.initialise();       

        System.out.println("  version: {}" + LibVlc.INSTANCE.libvlc_get_version());
        System.out.println(" compiler: {}" + LibVlc.INSTANCE.libvlc_get_compiler());
        System.out.println("changeset: {}" + LibVlc.INSTANCE.libvlc_get_changeset());
    }
}

1 个答案:

答案 0 :(得分:0)

错误表明您的计算机无法解析主机名repo.maven.apache.org,这是导致失败的原因。主机名在这里解析得很好,找到了maven存储库。所以我认为这是您本地DNS的一些问题。