Trouble With First Gradle/JOGL Project
<p>I'll start by saying I'm not asking for answers to a homework assignment, but I <strong>AM</strong> asking for help getting it set up in Eclipse. I'm in a computer graphics course where we've been assigned our first assignment using Gradle build tools and drawing in JOGL. The professor who assigned it doesn't use an IDE, so he said we're on our own if we want to run/compile in an IDE like Eclipse. We were given a zip file with a Gradle build that had some example classes as well as a "homework" file we have to modify and turn back in. The professor included some simple instructions on how to build the solution from the command line, and when I do that I can get the example code to run from the .bat files that are created, but after importing the files as a Gradle project in Eclipse and trying to run it I keep getting errors: </p>

<pre><code>Catched FileNotFoundException: C:\Users\ktbis_000\.gradle\caches\modules-2\files-2.1\org.jogamp.gluegen\gluegen-rt\2.1.5-01\f8d80652bb29eb2b9012fbafe1c160ba80775c\gluegen-rt-2.1.5-01-natives-windows-amd64.jar (The system cannot find the file specified), while addNativeJarLibsImpl(classFromJavaJar class com.jogamp.common.os.Platform, classJarURI jar:file:/C:/Users/ktbis_000/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen-rt/2.1.5-01/f8d80652bb29eb2b9012fbafe1c160ba80775c/gluegen-rt-2.1.5-01.jar!/com/jogamp/common/os/Platform.class, nativeJarBaseName gluegen-rt-2.1.5-01-natives-windows-amd64.jar): [ file:/C:/Users/ktbis_000/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen-rt/2.1.5-01/f8d80652bb29eb2b9012fbafe1c160ba80775c/gluegen-rt-2.1.5-01.jar -&gt; file:/C:/Users/ktbis_000/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen-rt/2.1.5-01/f8d80652bb29eb2b9012fbafe1c160ba80775c/ ] + gluegen-rt-2.1.5-01-natives-windows-amd64.jar -&gt; slim: jar:file:/C:/Users/ktbis_000/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen-rt/2.1.5-01/f8d80652bb29eb2b9012fbafe1c160ba80775c/gluegen-rt-2.1.5-01-natives-windows-amd64.jar!/
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\ktbis_000\Desktop\Computer Graphics\Homework 2\homework02\homework02\Build\ou-cs-cg\gluegen-rt.dll
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
  at java.lang.Runtime.load0(Runtime.java:809)
  at java.lang.System.load(System.java:1086)
  at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:551)
  at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
  at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:96)
  at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:414)
  at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:388)
  at com.jogamp.common.os.Platform$1.run(Platform.java:209)
  at java.security.AccessController.doPrivileged(Native Method)
  at com.jogamp.common.os.Platform.&lt;clinit&gt;(Platform.java:179)
  at javax.media.opengl.GLProfile.&lt;clinit&gt;(GLProfile.java:83)
  at edu.ou.cs.cg.homework.Homework02.main(Homework02.java:67)
</code></pre>

<p>I've tried the solution <a href="http://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE" rel="nofollow">here</a>, creating a separate JOGL project to contain the gluegen-rt.jar and jogl-all.jar, and making my homework project dependent on it, but I still can't get the code to run. Is there something I missed on import? That's the only reason I can think of that it would run from the .bat files and not from Eclipse.</p>

<p>Thanks for any help.</p>

<p><strong>EDIT:</strong> Here's the build.gradle file that was supplied to us. I've omitted small parts of the comments that contained professor's personal information.</p>

<pre><code>        //******************************************************************************
//******************************************************************************
// Last modified: Tue Feb  9 20:35:55 2016 by 
//******************************************************************************
// Major Modification History:
//
// 20160209 []: Original file.
//
//******************************************************************************
// Notes:
//
// To compile on the command line
// 1. Go to the directory that contains build.gradle
// 2. Run "gradle installDist"
//
// To run on the command line
// 1. Go to directory build/install/graphics/bin
// 2. Run the script for the class you want (./foo or double-click the icon).
//
//******************************************************************************
// COMMANDS:
//
// See all available tasks in the terminal, or in a window:
// gradle -q tasks --all
// gradle --gui
//
// Scrub all build results (doesn't remove .gradle cache in home directory):
// gradle clean
//
// Generate javadoc for all subprojects:
// gradle javadoc
//
// Bundle into command line applications, or a zip file containing them:
// gradle installDist
// gradle distZip
//
//******************************************************************************

buildscript
{
    repositories
    {
        mavenCentral()
    }
}

//******************************************************************************

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
apply plugin: 'eclipse'

//******************************************************************************

// Adapted from http://stackoverflow.com/questions/18421857/
// See also http://stackoverflow.com/questions/21241767/
//
// Creates scripts for entry points
// Subproject must apply application plugin to be able to call this method.
def createScript(project, mainClass, name, jvmOpts) {
  project.tasks.create(name: name, type: CreateStartScripts) {
    applicationName = name
    mainClassName   = mainClass
    defaultJvmOpts  = jvmOpts
    outputDir       = new File(project.buildDir, 'scripts')
    classpath       = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files +     project.configurations.runtime
  }
  project.tasks[name].dependsOn(project.jar)

  project.applicationDistribution.with {
    into("bin") {
      from(project.tasks[name])
      fileMode = 0755
    }
  }
}

//******************************************************************************

   sourceCompatibility = 1.6

group = "edu.ou.cs.cg"
version = '1.1.0'

applicationName = "template"
mainClassName = "edu.ou.cs.cg.example.Template"
applicationDefaultJvmArgs = ['-Xms128m', '-Xmx756m', '-noclassgc',\
 '-Dfile.encoding=utf-8', '-Dapple.laf.useScreenMenuBar=false',\
 '-Dapple.awt.showGrowBox=true', '-Dapple.awt.brushMetalLook=false',\
 '-Dapple.awt.antialiasing=on', '-Dapple.awt.graphics.UseQuartz=true', ]

//******************************************************************************
// Alternative Start Scripts
//******************************************************************************

def altJvmArgs = ['-Xms128m', '-Xmx768m', '-noclassgc',\
 '-Dfile.encoding=utf-8', '-Dapple.laf.useScreenMenuBar=false',\
 '-Dapple.awt.showGrowBox=true', '-Dapple.awt.brushMetalLook=false',\
 '-Dapple.awt.antialiasing=on', '-Dapple.awt.graphics.UseQuartz=true', ]

// Create scripts for alternate entry points (main() methods)
createScript(project, 'edu.ou.cs.cg.example.Gasket', 'gasket', altJvmArgs)
//createScript(project, 'edu.ou.cs.cg.example.Lorenz', 'lorenz', altJvmArgs)

// You'll need to add more of these for future assignments. For each one, put
// the fully qualified classname of the class with main() in the second argument
// and the desired program name in the third argument.
createScript(project, 'edu.ou.cs.cg.homework.Homework02', 'hw02', altJvmArgs)
//createScript(project, 'edu.ou.cs.cg.homework.Homework03', 'hw03', altJvmArgs)
//createScript(project, 'edu.ou.cs.cg.homework.Homework04', 'hw04', altJvmArgs)
//createScript(project, 'edu.ou.cs.cg.homework.Homework05', 'hw05', altJvmArgs)

//******************************************************************************
// Source Sets
//******************************************************************************

sourceSets
{
    main
    {
        resources
        {
            srcDir 'src/main/java'
            //include ".*.rsrc"
            exclude "**/.DS_Store", "**/*.java.*"
        }
    }
}

//******************************************************************************
// Tasks
 //******************************************************************************

jar
{
    manifest
    {
        attributes\
            'Implementation-Title': 'ou-cs-cg',\
            'Implementation-Version': version,\
            'Main-Class': mainClassName

            manifest.attributes provider: 'tribe7.net'
            manifest.attributes permissions: 'all-permissions'
            manifest.attributes codebase: '*'
    }
}

javadoc
{
    maxMemory '756m'
}

// Hack to use alternative maximum stack and heap sizes in Windows start     scripts.
// There are probably more elegant ways to do this in recent versions of Gradle.
// Note: This only affects primary scripts, not those using our createScript().
startScripts
{
    doLast
    {
        // Windows script file
        def wsf = file getWindowsScript()
        //wsf.text = wsf.text.replace("-Xms1g", "-Xms256m")
        //wsf.text = wsf.text.replace("-Xmx2g", "-Xmx1280m")
    }
}

//******************************************************************************
// Dependencies
//******************************************************************************

repositories
{
    mavenLocal()
    mavenCentral()
}

dependencies
{
     //**********************************************************************
     //REMOTE
    //**********************************************************************

    //runtime ('colt:colt:1.2.0') { transitive = false }

    //runtime ('com.vividsolutions:jts:1.13') { transitive = false }

    compile ('org.jogamp.jogl:jogl-all-main:2.1.5-01') { transitive = true }
    compile ('org.jogamp.gluegen:gluegen-rt-main:2.1.5-01') { transitive = true     }
}

//******************************************************************************
</code></pre>