I am trying to use Gradle application plugins as follows:-
build.gradle :-
group 'com.samsoft'
version '1.0-SNAPSHOT'
defaultTasks("clean", "build")
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'idea'
mainClassName = 'com.samsoft.Main'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}
src/main/java.Main.java :-
package com.samsoft;
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
After running gradle build, we have PRJECT/build/libs & PROJECT/build/scripts folders create and others. The libs has executable jar and its dependencies and scripts has .bat and .sh files to run the application.
PROBLEM
The script file has incorrect classpath as set CLASSPATH=%APP_HOME%\lib\hello-gradle-1.0-SNAPSHOT.jar
's' character is missing from lib which results in Error: Could not find or load main class com.samsoft.Main
while trying to run it.
How can I fix this ?
Gradle 3.5 Java 8