Problem with OpenJFX on Windows/Cygwin/SDKMAN Environment
Eric Bresie
ebresie at gmail.com
Sun Jul 2 17:23:03 UTC 2023
Probably a question I should have asked up front and may have missed it
someplace, but what is the version of JDK required for jfx from master?
I'm using JDK 17 at the moment. Is that still okay?
Will give that a try...
Before I got this email response I was poking around some...
I ran "sh gradlew --debug tasks" and noticed there appeared to be two
variations of paths showing up (see below). I could be wrong, but the
first looks like it might be okay in cygwin but the subsequent ones don't
look quite right to me (i.e., assume using cygwin it might treat the
"\home\.." as a "corrupt" path with the "\" escaping portions of the path).
2023-07-02T11:59:29.490-0500 [INFO] [org.gradle.api.Project] *Converting
> path '/home/<userhome>/.sdkman/candidates/java/current' via cygpath to
> /home/* <userhome>
> */.sdkman/candidates/java/current*2023-07-02T11:59:29.490-0500 [INFO]
> [org.gradle.api.Project] Converting path
> '/home/<userhome>/.sdkman/candidates/java/current/bin/java' via cygpath to
> *\home\<userhome>\.sdkman\candidates\java\current\bin\java*
> 2023-07-02T11:59:29.490-0500 [INFO] [org.gradle.api.Project] Converting
> path '/home/<userhome>/.sdkman/candidates/java/current/bin/javac' via
> cygpath to \home\<userhome>\.sdkman\candidates\java\current\bin\javac
> 2023-07-02T11:59:29.490-0500 [INFO] [org.gradle.api.Project] Converting
> path '/home/<userhome>/.sdkman/candidates/java/current/bin/javadoc' via
> cygpath to \home\<userhome>\.sdkman\candidates\java\current\bin\javadoc
> 2023-07-02T11:59:29.490-0500 [INFO] [org.gradle.api.Project] Converting
> path '/home/<userhome>/.sdkman/candidates/java/current/bin/jmod' via
> cygpath to \home\<userhome>\.sdkman\candidates\java\current\bin\jmod
> 2023-07-02T11:59:29.491-0500 [INFO] [org.gradle.api.Project] Converting
> path 'null/jmods' via cygpath to null/jmods
Not sure if it's related but in the build.gradle file, I noticed the below
"cygpath helper methods" defined. Does the build.gradle not truely use the
actual "cygpath" and instead just tries to mirror the behavior within? Is
it possible the build.gradle cygpath related conversions are a little off
around the highlighted places and/or need the "-m" (mixed) type of logic
included?
/**
>
> * Converts cygwin style paths to windows style paths, but with a forward
> slash.
> * This method is safe to call from any platform, and will only do work if
> * called on Windows (in all other cases it simply returns the supplied
> path.
> *
> * @param path the path to convert
> * @return the path converted to windows style, if on windows, otherwise it
> * is the supplied path.
> */
> String cygpath(String path) {
> if (!IS_WINDOWS) return path;
> if (path == null || "".equals(path)) return path;
> * String ret = path.replaceAll('\\\\', '/')*
> logger.info("Converting path '$path' via cygpath to "+ret)
> return ret
> }
> /**
> * Converts cygwin file paths for java executables to windows style
> * executable paths by changing forward slashes to back slashes and
> * adding the '.exe' extension.
> * This method is safe to call from any platform, and will only do work if
> * called on Windows (in all other cases it simply returns the supplied
> path).
> *
> * @param path the path to convert
> * @return the path converted to windows style, if on windows, otherwise it
> * is the supplied path.
> */
> String cygpathExe(String path) {
> if (!IS_WINDOWS) return path;
> if (path == null || "".equals(path)) return path;
> *String ret = path.replaceAll('/', '\\\\')*
> logger.info("Converting path '$path' via cygpath to "+ret)
> return ret + ".exe"
> }
>
>
Eric Bresie
ebresie at gmail.com
On Sun, Jul 2, 2023 at 11:50 AM John Neffenger <john at status6.com> wrote:
> On 7/2/23 9:21 AM, Eric Bresie wrote:
>
> * What went wrong:
> A problem occurred evaluating root project 'jfx'.
> > Missing or incorrect path to 'java':
> '\home\<userHome>\.sdkman\candidates\java\current\bin\java.exe'. Perhaps
> bad JDK_HOME? /home/ <userHome> /.sdkman/candidates/java/current
>
> You might need to use the cygpath command to set those environment
> variables. I finally got builds working well on Windows with the following
> script
> <https://github.com/jgneff/jfxbuild/blob/main/win10/bin/jfxbuild.env> for
> setting up the environment variables in Cygwin:
> ------------------------------
>
> #!/bin/bash
> # Sets up the environment for building JavaFX
>
> # Path must include 'C:\Windows\System32'
> syspath=/usr/sbin:/usr/bin:/sbin:/bin:/cygdrive/c/Windows/System32
>
> # Visual Studio Build Tools 2022
> export VS150COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build"
>
> cmake=$HOME/opt/cmake-3.26.4-windows-x86_64
> jdk=$HOME/opt/jdk-19.0.2
> ant=$HOME/opt/apache-ant-1.10.13
>
> CMAKE_HOME=$(cygpath -m "$cmake")
> JAVA_HOME=$(cygpath -m "$jdk")
> ANT_HOME=$(cygpath -m "$ant")
> SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
>
> export CMAKE_HOME
> export JAVA_HOME
> export ANT_HOME
> export SOURCE_DATE_EPOCH
>
> # JDK_HOME and PATH are required by the build
> export JDK_HOME="$JAVA_HOME"
> export PATH=$ant/bin:$jdk/bin:$cmake/bin:$syspath
>
> ------------------------------
>
> See my repository at jgneff/jfxbuild
> <https://github.com/jgneff/jfxbuild/tree/main> for the scripts I use to
> run the builds.
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230702/d7154230/attachment.htm>
More information about the openjfx-dev
mailing list