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

[core] designer.bat errors when JAVAFX_HOME contains spaces #3328

Closed
zzzzfeng opened this issue Jun 9, 2021 · 2 comments · Fixed by #3726
Closed

[core] designer.bat errors when JAVAFX_HOME contains spaces #3328

zzzzfeng opened this issue Jun 9, 2021 · 2 comments · Fixed by #3726
Assignees
Labels
a:bug PMD crashes or fails to analyse a file. in:cli Affects the PMD Command Line Interface
Milestone

Comments

@zzzzfeng
Copy link

zzzzfeng commented Jun 9, 2021

Affects PMD Version:

version 6.35.0
Windows

Description:

error code:
[%JAVAFX_HOME%] EQU []

runtime error:
if [C:\Program Files\javafx-sdk-11.0.2\] EQU [] (
此时不应有 Files\javafx-sdk-11.0.2\]。

fix:
["%JAVAFX_HOME%"] EQU [""]

@zzzzfeng zzzzfeng added the a:bug PMD crashes or fails to analyse a file. label Jun 9, 2021
@LY1806620741
Copy link

LY1806620741 commented Dec 27, 2021

I have the same problem as you.
This bug exists in windows10, Because space symbol in Env variable.

if [%JAVAFX_HOME%] EQU [] (

@oowekyala oowekyala added this to the 6.42.0 milestone Dec 27, 2021
@adangel adangel self-assigned this Jan 13, 2022
@adangel
Copy link
Member

adangel commented Jan 13, 2022

In this example:

> set JAVAFX_HOME="C:\Program Files\javafx-sdk-17.0.1"
> bin\designer.bat
Fehler: Hauptklasse Files\javafx-sdk-17.0.1\lib\* konnte nicht gefunden oder geladen werden
Ursache: java.lang.ClassNotFoundException: Files\javafx-sdk-17.0.1\lib\*

my error is a bit different: it can't find the main class - which means the command line for calling java is messed up.

Adding the suggested fix makes things worse:

"Files\javafx-sdk-17.0.1""]" kann syntaktisch an dieser Stelle nicht verarbeitet werden.

After reading http://windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/ the problem is actually here:

java %PMD_JAVA_OPTS% %jreopts% -classpath "%classpath%" %OPTS% %MAIN_CLASS% %*

The quotes around "%classpath%" are wrong.

@adangel adangel added the in:cli Affects the PMD Command Line Interface label Jan 13, 2022
@adangel adangel changed the title designer.bat has a error, that could not run [core] designer.bat has a error, that could not run Jan 13, 2022
@adangel adangel changed the title [core] designer.bat has a error, that could not run [core] designer.bat has a error when javafx_home contains spaces Jan 13, 2022
@adangel adangel changed the title [core] designer.bat has a error when javafx_home contains spaces [core] designer.bat has a error when JAVAFX_HOME contains spaces Jan 13, 2022
@adangel adangel changed the title [core] designer.bat has a error when JAVAFX_HOME contains spaces [core] designer.bat errors when JAVAFX_HOME contains spaces Jan 13, 2022
adangel added a commit to adangel/pmd that referenced this issue Jan 13, 2022
@adangel adangel modified the milestone: 6.42.0 Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file. in:cli Affects the PMD Command Line Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants