| 1 |
@echo off |
| 2 |
set TOPDIR=%~dp0.. |
| 3 |
set OPTS= |
| 4 |
set MAIN_CLASS=net.sourceforge.pmd.util.fxdesigner.DesignerStarter |
| 5 |
|
| 6 |
|
| 7 |
:: sets the jver variable to the java version, eg 901 for 9.0.1+x or 180 for 1.8.0_171-b11 |
| 8 |
:: sets the jvendor variable to either java (oracle) or openjdk |
| 9 |
for /f tokens^=1^,3^,4^,5^ delims^=.-_+^"^ %%j in ('java -version 2^>^&1 ^| find "version"') do ( |
| 10 |
set jvendor=%%j |
| 11 |
if %%l EQU ea ( |
| 12 |
set /A "jver=%%k00" |
| 13 |
) else ( |
| 14 |
set /A jver=%%k%%l%%m |
| 15 |
) |
| 16 |
) |
| 17 |
|
| 18 |
Set "jreopts=" |
| 19 |
:: oracle java 9 and 10 has javafx included as a module |
| 20 |
if /I "%jvendor%" EQU "java" ( |
| 21 |
if %jver% GEQ 900 ( |
| 22 |
if %jver% LSS 1100 ( |
| 23 |
:: enable reflection |
| 24 |
Set jreopts=--add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED |
| 25 |
) |
| 26 |
) |
| 27 |
) |
| 28 |
|
| 29 |
set "_needjfxlib=0" |
| 30 |
if /I "%jvendor%" EQU "openjdk" set _needjfxlib=1 |
| 31 |
if /I "%jvendor%" EQU "java" ( |
| 32 |
if %jver% GEQ 1100 set _needjfxlib=1 |
| 33 |
) |
| 34 |
if %_needjfxlib% EQU 1 ( |
| 35 |
if %jver% LSS 1000 ( |
| 36 |
echo For openjfx at least java 10 is required. |
| 37 |
pause |
| 38 |
exit |
| 39 |
) |
| 40 |
if [%JAVAFX_HOME%] EQU [] ( |
| 41 |
echo The environment variable JAVAFX_HOME is missing. |
| 42 |
pause |
| 43 |
exit |
| 44 |
) |
| 45 |
set "classpath=%TOPDIR%\pmd\*;%JAVAFX_HOME%\lib\*" |
| 46 |
) else ( |
| 47 |
set "classpath=%TOPDIR%\pmd\*" |
| 48 |
) |
| 49 |
|
| 50 |
|
| 51 |
java %PMD_JAVA_OPTS% %jreopts% -classpath "%classpath%" %OPTS% %MAIN_CLASS% %* |