8 Replies - 354 Views - Last Post: 30 October 2017 - 08:45 AM

#1 unknownusernameunderdog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-July 17

Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 05:23 AM

I am using gradle sts my source of knowledge is a book. I am using eclipse.I have installed git gradle i used command
gradle wrapper


git init


git status-s


git add .


My build gradle file:
buildscript {
	ext {
		springBootVersion = '1.5.8.RELEASE'
	}
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
	}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
	mavenCentral()
}


dependencies {
	compile('org.springframework.boot:spring-boot-starter-web')
	testCompile('org.springframework.boot:spring-boot-starter-test')
}
task wrapper(type: Wrapper) {
	gradleVersion = '2.9'
}



and now i Can't use

./gradlew bootrun


It doesn't work .Do you know why?

Is This A Good Question/Topic? 0
  • +

Replies To: Hi I am learning spring but I can't run the script

#2 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3447
  • View blog
  • Posts: 15,615
  • Joined: 20-September 08

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 05:42 AM

Quote

It doesn't work .Do you know why?

http://technojeeves....1/77-doesntwork
Was This Post Helpful? 0
  • +
  • -

#3 unknownusernameunderdog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-July 17

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 06:39 AM

Still problem.. do you know I need modify something in build.gradle ?? Just give me a tip :)
Was This Post Helpful? 0
  • +
  • -

#4 ndc85430  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 594
  • Posts: 2,490
  • Joined: 13-June 14

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 06:44 AM

You seem to have missed g00se's point: you've told us that something isn't working, but you haven't given enough details for anyone to help you. Please explain more clearly what "it doesn't work" means.
Was This Post Helpful? 0
  • +
  • -

#5 unknownusernameunderdog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-July 17

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 07:55 AM

output:
C:\Users\lukas\workspace\masterSpringMvc>./gradlew bootrun
'.' is not recognized as an internal or external command,
operable program or batch file.


Was This Post Helpful? 0
  • +
  • -

#6 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3447
  • View blog
  • Posts: 15,615
  • Joined: 20-September 08

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 08:10 AM

C:\Users\lukas\workspace\masterSpringMvc>gradlew bootrun
is what you need (providing gradlew in same directory)

Windows will get confused if you use the wrong path separator

This post has been edited by g00se: 29 October 2017 - 09:05 AM
Reason for edit:: Clarification

Was This Post Helpful? 0
  • +
  • -

#7 unknownusernameunderdog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-July 17

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 09:13 AM

next output:

C:\Users\lukas\workspace\masterSpringMvc>gradlew bootrun
Downloading https://services.gradle.org/distributions/gradle-2.9-bin.zip
..........................................
Unzipping C:\Users\lukas\.gradle\wrapper\dists\gradle-2.9-bin\ebaspjjvvkuki3ldbldx7hexd\gradle-2.9-bin.zip to C:\Users\lukas\.gradle\wrapper\dists\gradle-2.9-bin\ebaspjjvvkuki3ldbldx7hexd

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '9.0.1'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

C:\Users\lukas\workspace\masterSpringMvc>gradlew bootrun --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '9.0.1'.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
java.lang.IllegalArgumentException: Could not determine java version from '9.0.1'.
        at org.gradle.api.JavaVersion.toVersion(JavaVersion.java:63)
        at org.gradle.api.JavaVersion.current(JavaVersion.java:72)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:32)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)


C:\Users\lukas\workspace\masterSpringMvc>



and how to access the data from this??

This post has been edited by unknownusernameunderdog: 29 October 2017 - 09:14 AM

Was This Post Helpful? 0
  • +
  • -

#8 ndc85430  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 594
  • Posts: 2,490
  • Joined: 13-June 14

Re: Hi I am learning spring but I can't run the script

Posted 29 October 2017 - 11:22 AM

It looks like you're using quite an old version of Gradle that doesn't work well with Java 9 (presumably because the naming scheme has changed). If you're going to stick with Java 9, then you'll want to upgrade Gradle (see, e.g. this).
Was This Post Helpful? 0
  • +
  • -

#9 unknownusernameunderdog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-July 17

Re: Hi I am learning spring but I can't run the script

Posted 30 October 2017 - 08:45 AM

Yes it works well but every next gradlew bootrun there is a problem because of port 8080 isn't in my opinion available. restart system works and one time the bootrun works properly but next fails. Regards
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1