简体   繁体   English

如何使用gradle插件在netbeans中获得项目以查找本地库?

[英]How can I get a project in netbeans using the gradle plugin to find native libraries?

I am trying to figure out gradle and the netbeans plugin. 我试图找出gradle和netbeans插件。 I have easily been able to put together simple projects, but when trying to convert a project that uses JOGL to gradle I have run into problems. 我很容易就能将简单的项目组合在一起,但是当尝试转换使用JOGL进行gradle的项目时,我遇到了问题。 I can get it to compile, but when I try to get it to run, it does not. 我可以编译它,但是当我尝试使其运行时,它没有。 I assume it is not finding the native libraries. 我认为它没有找到本机库。

Here is my build.gradle: 这是我的build.gradle:

apply plugin: 'java'
apply plugin: 'application'

sourceCompatibility = '1.6'

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

// NetBeans will automatically add "run" and "debug" tasks relying on the                      
// "mainClass" property. You may however define the property prior executing                   
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.                           
//                                                                                             
// Note however, that you may define your own "run" and "debug" task if you                    
// prefer. In this case NetBeans will not add these tasks but you may rely on                  
// your own implementation.                                                                    
if (!hasProperty('mainClass')) {
    ext.mainClass = 'com.protocase.viewer.JDesigner'
}

repositories {
    mavenCentral()
    maven {
        url "https://repository.apache.org/content/repositories/snapshots/"
    }
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.10'
    compile files('../logger/dist/logger.jar')
    compile files('../postalker/build/libs/postalker.jar')
    compile group: 'org.yaml', name: 'snakeyaml', version: '1.15+'
    compile group: 'commons-io', name: 'commons-io', version: '2.4+'
    compile group: 'gov.nist.math', name: 'jama', version: '1.0.3+'
    compile group: 'org.apache.commons', name: 'commons-imaging', version: '1.0-SNAPSHOT+'
    compile group: 'com.itextpdf', name: 'itextpdf', version: '5.5.5+'
    compile files('/home/vextorspace/.netbeans/8.0.2/jogl-runtime/jogl.jar')
    compile files('~/.netbeans/8.0.2/jogl-runtime/jogl.jar-natives-linux-amd64/libjogl_awt.so'\
, '~/.netbeans/8.0.2/jogl-runtime/jogl.jar-natives-linux-amd64/libjogl_cg.so', '~/.netbeans/8.\
0.2/jogl-runtime/jogl.jar-natives-linux-amd64/libjogl.so')
    runtime fileTree(dir: '~/.netbeans/8.0.2/jogl-runtime/jogl.jar-natives-linux-amd64/', incl\
ude: '*.so')
    compile files('~/.netbeans/8.0.2/gluegen-runtime/gluegen-rt.jar')
    runtime files('~/.netbeans/8.0.2/gluegen-runtime/gluegen-rt.jar-natives-linux-amd64/libglu\
egen-rt.so')
    compile files('libs/toxiclibscore.jar')
    compile group: 'org.apache.commons', name: 'commons-math3', version: '3.5+'
    compile group: 'commons-codec', name: 'commons-codec', version: '1.6'
    compile group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
    compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.3.3'
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.6'
    compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.6'
}

but when I try to run I get 但是当我尝试跑步时,我得到了

Executing: gradle run

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper
        at java.lang.ClassLoader.defineClass1(Native Method)

Any help would be much appreciated! 任何帮助将非常感激!

Thank you 谢谢

Avoid tilde character in paths in your build script. 避免在构建脚本的路径中出现波浪号字符。 It is interpreted by bash when you use it on command line and Gradle knows nothing about it. 当您在命令行上使用bash时,它会被bash解释,而Gradle对此一无所知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 gradle 在 netbeans 中构建新的项目结构? - How do I build a new project structure in netbeans using gradle? 如何使用Netbeans中的本机依赖项调试Gradle项目? - How do you debug a Gradle project with native dependencies in Netbeans? 如何使用库访问在netbeans中定义的bean类,可以在新项目的主要方法中使用 - how to access my bean class defined in netbeans using libraries can be used in main method of new project 如何在Netbeans平台上获得项目类型? - How can I get a project type on Netbeans Platform? 使用Putty,Gradle和Gradle Git插件时,如何修复“不兼容的JNA本机库”? - How do I fix “incompatible JNA native library” when using Putty, Gradle, and the Gradle Git plugin? 如何在NetBeans的项目中导入库? - How do I import libraries in my project in netbeans? 如何使用NetBeans将Maven库添加到ant项目 - how can I add a Maven library to an ant project using netbeans 如何使用Netbeans在ftp服务器上共享Java项目? - How can i share Java project on ftp server using Netbeans? 无法使用NetBeans 8.1的Gradle支持插件构建Gradle项目 - Cannot build Gradle project with Gradle Support plugin for NetBeans 8.1 如何使用Gradle将另一个项目的类库包含在我的jar中? - How do I include another project's class libraries in my jar using Gradle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM