shenjianeng commented on issue #693:
URL: https://github.com/apache/maven-mvnd/issues/693#issuecomment-1588788509

   yeah, can't read system env.
   
   but you can use that:
   
   ```java
   // org.mvndaemon.mvnd.client.DaemonParameters#javaHome
   public Path javaHome() {
           final Path result = value(Environment.JAVA_HOME)
                   .orLocalProperty(provider, suppliedPropertiesPath())
                   .orLocalProperty(provider, localPropertiesPath())
                   .orLocalProperty(provider, userPropertiesPath())
                   .orLocalProperty(provider, globalPropertiesPath())
                   .orSystemProperty()
                   .orEnvironmentVariable()
                   .or(new ValueSource(
                           description -> description.append("java command"), 
DaemonParameters::javaHomeFromPath))
                   .orFail()
                   .cache(provider)
                   .asPath();
           try {
               return result.toRealPath();
           } catch (IOException e) {
               throw new RuntimeException("Could not get a real path from path 
" + result);
           }
       }
   ```
   
   remove config file ,
   
   use SystemProperty : `mvnd clean deploy -Dmaven.test.skip=true -Ptest 
-Djava.home=/opt/jdk-11.0.17+8/`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to