Problem with getting started with the SDK examples

  • 1 Replies
  • 287 Views
Problem with getting started with the SDK examples
« on: July 16, 2018, 15:44:07 pm »
Hello,

I have a problem with running the example from here:
https://github.com/testproject-io/java-sdk-examples/tree/master/Web

I am new to java programming and to gradle.

I did the following steps:
1) In IntelliJ IDEA I clicked on File -> Open and then I wrote the path to the web folder(java-sdk-examples\java-sdk-examples\Web).

It loaded the project but there are problems:
this is what it show:

Code
Invalid Gradle JDK configuration found. Open Gradle Settings 
Project JDK is not specified. Open Project SDK Configuration

Image:
http://prntscr.com/k72a7p


I know that I need to install gradle. I did the following guide:
https://docs.gradle.org/current/userguide/installation.html
using Chocolatey package manager.

I also downloaded the "io.testproject.sdk.java.jar" file and in the build.grade settings, under dependencies section (inside the {} ) I changed the path to the file to the currect path.

This is the configuration of the file:

Code
group 'io.testproject'
version '0.1'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

// Configurations
configurations {
    tpsdk
    compile.extendsFrom tpsdk
}

// JAR Task
jar {
    archiveName "${rootProject.name}-${version}.jar"
    dependsOn configurations.runtime
    from {
        // Removes TestProject SDK from the final jar file
        (configurations.runtime - configurations.tpsdk).collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }
}

dependencies {
    // Update the location of the sdk as required
    tpsdk files('D:\\tools\\io.testproject.sdk.java.jar')
    testCompile group: 'junit', name: 'junit', version: '4.12'
}


Thank you.

Re: Problem with getting started with the SDK examples
« Reply #1 on: July 16, 2018, 16:11:11 pm »
Hello Goku,

It looks like there is no JDK configuration in your project.
Please make sure that you have [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html]JDK installed.
After that, go to Gradle settings in you Intellij IDE (File-->Settings-->Build,Execution,Deployment-->Build Tools-->Gradle) and make sure you've selected:
  • Use default gradle wrapper (recommended)
  • Gradle JVM: The installed JDK version (for example: 1.8)

 

Sitemap 1 2 3 4 5 6 7 8