Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when using Cygwin and useWildcardClassPath=true #61

Open
jgebal opened this issue Nov 21, 2017 · 2 comments · May be fixed by #94
Open

Errors when using Cygwin and useWildcardClassPath=true #61

jgebal opened this issue Nov 21, 2017 · 2 comments · May be fixed by #94

Comments

@jgebal
Copy link

jgebal commented Nov 21, 2017

Shell script generated with useWildcardClassPath=true is not working properly on Git Bash command-line. (MINGW64).

Symptoms:

  • When trying to run project on a cygwin console i get: Error: Could not find or load main class
  • The Windows bat works fine and the shell script executes fine on Linux machine.
  • The shell script works fine on Git Bash when using: useWildcardClassPath=false

After some investigation I've found that the issue is related to the wildcard in path and the fact that cygpath conversion is actually not invoked and for some reasons Unix-style CLASSPATH is ok without wildcard, but with wildcard it is not.

Change from:

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  Darwin*) darwin=true

To:

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  MINGW*) cygwin=true ;;
  Darwin*) darwin=true

Solves the issue.

Can you incorporate support for git-bash (MINGW64)?
It seems more and more popular nowadays.

@jgebal
Copy link
Author

jgebal commented Nov 21, 2017

To add more context:

$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

After a bit more digging, I've noticed that without cygwin=true no paths except JAVA_HOME are getting converged to Windows format and is the only one that stays in Windows-style format as opposed to all the rest of path variables:
example:

CLASSPATH =>"/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/*:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/etc:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/java-api-3.0.4.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/jcommander-1.69.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/HikariCP-2.7.2.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/slf4j-api-1.7.25.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/slf4j-nop-1.7.25.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/cli-3.0.4-SNAPSHOT.jar"
JAVA_HOME =>"C:\Program Files\Java\jdk1.8.0_40"
HOME =>"/c/Users/Jacek"
BASEDIR =>"/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli"
REPO =>"/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib"

Enabling cygwin=true causes all paths to be in the same (Windows) style.

@jgebal
Copy link
Author

jgebal commented Nov 21, 2017

I get exactly the same error when running script generated with flag: endorsedDir=true

mef added a commit to mef/appassembler that referenced this issue Jun 14, 2019
@mef mef linked a pull request Jun 14, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant