Comments (10)
This is likely because you're running maven with a JRE, not a JDK.
Although this should work on most platforms, it seems it does not work on yours.
- What does
./mvnw -v
emit? - What is the layout of
F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre
on your machine?
from spring-cloud-deployer-local.
Hi.
What is the layout of F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre on your machine?
The layout of my ...\jre is bin, lib plus all other child files under the jre directory - the original layout and content of the java distribution. There is no bin\java
This is not (in my opinion) an environment issue as I already performed all the necessary Googling to figure out why I was seeing the observed problems which led me to this class.
My JAVA_HOME is set correctly. "java.home" refers to JRE_HOME (Oracle documentation). My jdk bin is on my PATH out in front.
What does ./mvnw -v emit?
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: F:\lib-tools\tools\maven\apache-maven-3.5.0-bin\bin..
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "x86", family: "windows"
I stepped through the code and the toString of File returns "F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre\bin\java" which points to a non-existent file
Although this should work on most platforms, it seems it does not work on yours.
I'm not sure how the below test harness works on most platforms other then failing on the assertion.
I created a quick and simple test harness to demonstrate the behavior.
`
package com.tdt;
import java.io.File;
import org.junit.Assert;
public class TestJavaHome {
public static String JAVA_COMMAND = "java";
public static String JAVA_COMMAND_EXE = "java.exe";
public static void main(String[] args){
String javaExecutablePath = JAVA_COMMAND;
String javaHome = System.getProperty("java.home");
File javaExecutable = new File(javaHome, "bin/" + javaExecutablePath);
Assert.assertTrue("Java executable discovered via 'java.home' system property '" + javaHome + "' is not executable or does not exist.", javaExecutable.canExecute());
}
}`
The failed assertion is what is causing the tests to fail when running maven and ultimately the build to fail (although I know I can skip the tests).
The key point here is that "java" (without the file extension) points to nothing. If this is intended behavior then please explain the apparent incorrect purpose as it currently exists in the code base.
Thanks.
from spring-cloud-deployer-local.
In most java tool installations, JAVA_HOME is meant to point to a JDK installation (not a JRE).
I recommend changing this (at least for the session / script) that you use to launch SCDF
from spring-cloud-deployer-local.
Hi.
My JAVA_HOME is set to "F:\lib-tools\libs\java\jdk-1.8.0_60_x64" - the JDK. Which is the correct path for JAVA_HOME. It is not set to "F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre" which is what I think is your assumption.
There is no:
- F:\lib-tools\libs\java\jdk-1.8.0_60_x64\java, or
- F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre\java or
- F:\lib-tools\libs\java\jdk-1.8.0_60_x64\bin\java or
- F:\lib-tools\libs\java\jdk-1.8.0_60_x64\jre\bin\java
ON a Windows environment, the code I provided above executes the same code in LocalDeployerProperties.java.
As it is coded the assertion will never hold true.
Am I missing something? Perhaps you could execute the main method I provided above, observe the results and tell me your execution passes true?
Or could you possibly explain why setting JAVA_COMMAND to "java" instead of "java.exe" is correct.
Thanks for your time.
from spring-cloud-deployer-local.
My bad, I did not even realize there was the .exe
extension problem.
LocalDeployerProperties
being a @ConfigurationProperties
class, you can override the value by setting eg the environment variable SPRING_CLOUD_DEPLOYER_LOCAL_JAVA_CMD
from spring-cloud-deployer-local.
Please, could you confirm the above solution suits your needs? If so, feel free to close this issue.
Thanks
from spring-cloud-deployer-local.
Hi, @KingRokHead: It'd be great if you can share your findings and close the issue.
from spring-cloud-deployer-local.
Hey,
Apologies for not responding sooner as I have been in the process of moving.
LocalDeployerProperties being a @ConfigurationProperties class, you can override the value by setting eg the environment variable SPRING_CLOUD_DEPLOYER_LOCAL_JAVA_CMD
I will try the above work around within the week.
from spring-cloud-deployer-local.
Hello
I did the following combinations in the same console:
For JDK
SET SPRING_CLOUD_DEPLOYER_LOCAL_JAVA_CMD=C:\whiteroom\java\jdk1.8.0_131\bin
SET SPRING_CLOUD_DEPLOYER_LOCAL_JAVA_CMD=C:\whiteroom\java\jdk1.8.0_131\bin;%PATH%
For JRE
SET SPRING_CLOUD_DEPLOYER_LOCAL_JAVA_CMD=C:\whiteroom\java\jre1.8.0_131\bin
SET SPRING_CLOUD_DEPLOYER_LOCAL_JAVA_CMD=C:\whiteroom\java\jre1.8.0_131\bin;%PATH%
For any of these possible 4 options, I got the same issue yet.
Not sure if I am doing something wrong
from spring-cloud-deployer-local.
@ericbottard btw, I just PR'd #58 which relates to this.
from spring-cloud-deployer-local.
Related Issues (20)
- Getting log defaults to stderr
- Remove sample modules
- Remote debugger doesn't work with JDK9+
- network deployer property has no effect
- Support for volumes and port mappings in SCDF local deployment HOT 1
- (Docker-Compose) Deployed applications should be able to override the datasource configuraitons inherided from the Skipper or Dataflow servers
- Create an option to deploy .NET applications without docker
- Migrate to junit5
- Stream applications running in Skipper inherit JAVA_TOOL_OPTIONS
- backport(205): Stream applications running in Skipper inherit JAVA_TOOL_OPTIONS
- backport(205): Stream applications running in Skipper inherit JAVA_TOOL_OPTIONS
- Resource limits ignored for docker local HOT 1
- Provide access to actuator for deployed apps HOT 1
- SocketUtils has been removed from Spring Framework 6.x
- Local Deployer needs to verify ports for launching apps
- maxConcurrentExecutionsReached() has a race-condition where multiple instances can start before it returns a result
- How to customize job results log folder name.
- Fix repo.spring.io references in main branch
- LocalAppDeployer can't execute symlinked `docker` HOT 1
- LocalAppDeployer scaling operations causes too many created empty, unnecessary & unused dirs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-deployer-local.