1

I am writing simple application to be familiar with spring batch. I wanted to learn spring batch admin I found that it is deprecated so I have to use spring cloud data flow instead.

I've tutorial about spring cloud data and did first steps:

  1. Added dependency:

    compile("org.springframework.cloud:spring-cloud-starter-dataflow-server-local:1.7.4.RELEASE")

  2. And marked my spring boot application class with additioanl annotaion:

    @EnableDataFlowServer

Now I am trying to run it using idea but it prints:

19:14   Error running 'MyApplication': Command line is too long. Shorten command line for MyApplication or also for Spring Boot default configuration.

For that moment I thought that it is IDEA bug and tried to use gradle (via idea plugin) to run application using boot run but it is started too:

19:15:21: Executing task 'bootRun'...

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileJava
:processResources UP-TO-DATE
:classes
:bootRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_111\bin\java.exe''

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

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
3 actionable tasks: 2 executed, 1 up-to-date
CreateProcess error=206, The filename or extension is too long
19:15:26: Task execution finished 'bootRun'.

How can I fix that ?

P.S.

My repo is https://github.com/gredwhite/spring-batch-hello-world

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

2

Use one of the options to shorten the command line:

shorten

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • After choosing one of the option the error was changed if I run using idea. But it didn't disappear if I use gradle spring boot runner.Do you know how to fix it ? Could you please elaborate about this issue? why does it happen? – gstackoverflow Aug 09 '19 at 07:22
  • @gstackoverflow It happens because of the OS limits for the maximum command line length. When you have a lot of jars in the dependencies, the command line becomes too long and OS cannot start the process. IntelliJ IDEA provides this feature to workaround the OS limitation. See https://stackoverflow.com/a/3205048/104891. – CrazyCoder Aug 09 '19 at 07:28
  • Do you know any workaround for gradle spring boot plugin? – gstackoverflow Aug 09 '19 at 08:43
  • @gstackoverflow you can try [this plug-in](https://github.com/viswaramamoorthy/gradle-util-plugins). See also the corresponding [bug report](https://github.com/gradle/gradle/issues/1989). – CrazyCoder Aug 09 '19 at 18:23
  • hashtag:Voodoo. Thanks. – granadaCoder Sep 04 '19 at 14:13