# Start-script for my HelloWorld Scala doesn't have correct CLASSPATH

**URL:** <https://discuss.gradle.org/t/start-script-for-my-helloworld-scala-doesnt-have-correct-classpath/18171>\
**Category:** Bugs\
**Created:** [June 22, 2016, 1:20pm UTC](https://discuss.gradle.org/t/start-script-for-my-helloworld-scala-doesnt-have-correct-classpath/18171 "2016-06-22T13:20:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennykaiyinyu](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kennykaiyinyu](https://discuss.gradle.org/u/kennykaiyinyu)\
**Post date:** [June 22, 2016, 1:20pm UTC](https://discuss.gradle.org/t/start-script-for-my-helloworld-scala-doesnt-have-correct-classpath/18171/1 "2016-06-22T13:20:29Z")

</div>

Hi

Gradle version 2.5.

I’m trying to build a HelloWorld (Scala) with startScripts.

So in the root project (i named it gradle-test), i made the following directory structure and files

```gradle
C:\Users\kennyyu\gradle-test>tree /F
Folder PATH listing
Volume serial number is 606C-96AD
C:.
│ build.gradle
│
└───src
    └───main
        └───scala
            └───hello
                    HelloWorld.scala
C:\Users\kennyyu\gradle-test>

```

the build.gradle is given by below

```gradle
apply plugin: 'scala'
apply plugin: 'application'

mainClassName = 'hello.HelloWorld'

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.scala-lang:scala-library:2.11.1'
}

```

the HelloWorld Scala file is given by the following

```gradle
package hello

object HelloWorld {
        def main(args: Array[String]) { println("Hello World!") }
}

```

i tried `gradle -q run`

```gradle
C:\Users\kennyyu\gradle-test>gradle -q run
Hello World!
C:\Users\kennyyu\gradle-test>

```

and it does hello world as expected.

but then i tried to create start scripts:

```gradle
C:\Users\kennyyu\gradle-test>gradle startScripts
:compileJava UP-TO-DATE
:compileScala UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:startScripts UP-TO-DATE

BUILD SUCCESSFUL

Total time: 2.77 secs
C:\Users\kennyyu\gradle-test>build\scripts\gradle-test.bat
Error: Could not find or load main class hello.HelloWorld

C:\Users\kennyyu\gradle-test>

```

but it didn’t suceed.

I then tried to troubleshoot by reading into the generated start-up script (wiz the gradle-test.bat i just ran) - it seems to me it tried to find the jars in the lib/ folder:

```gradle
C:\Users\kennyyu\gradle-test>type build\scripts\gradle-test.bat
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem gradle-test startup script for Windows
...
...
set CLASSPATH=%APP_HOME%\lib\gradle-test.jar;%APP_HOME%\lib\scala-library-2.11.1.jar
...
...

```

but indeed the “gradle startScripts” task generated some JAR in the libs/ folder, not the lib/ folder. And there isn’t the scala library jar in the libs/ folder either.

```gradle
C:\Users\kennyyu\gradle-test>tree /f
Folder PATH listing
Volume serial number is 606C-96AD
C:.
│ build.gradle
│
├───.gradle
│ └───2.5
│ └───taskArtifacts
│ cache.properties
│ cache.properties.lock
│ fileHashes.bin
│ fileSnapshots.bin
│ outputFileStates.bin
│ taskArtifacts.bin
│
├───build
│ ├───classes
│ │ └───main
│ │ └───hello
│ │ HelloWorld$.class
│ │ HelloWorld.class
│ │
│ ├───libs
│ │ gradle-test.jar
│ │
│ ├───scripts
│ │ gradle-test
│ │ gradle-test.bat
│ │
│ └───tmp
│ ├───compileScala
│ └───jar
│ MANIFEST.MF
│
└───src
    └───main
        └───scala
            └───hello
                    HelloWorld.scala

C:\Users\kennyyu\gradle-test>

```

may i confirm whether it’s a bug? or i might have done something wrong?

thanks!

Gradle Version: 2.5  
Operating System: Windows 7  
Is this a regression? No
