[ https://issues.apache.org/jira/browse/NETBEANS-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16722022#comment-16722022 ]
TAKAHASHI,Toru commented on NETBEANS-1788: ------------------------------------------ One idea of fix this problem, at first convert path string with slash directory separator, then use regex. # location of ${run.module.dir} with slash dirsep {noformat} <pathconvert property="run.modules.dir.location.unix" dirsep="/"> <path location="${run.modules.dir}"/> </pathconvert> {noformat} # absolute path of main class with slash dirsep {noformat} <pathconvert property="main.class.absolutepath.unix" dirsep="/"> <fileset dir="${run.modules.dir}" includes="**/${toString:main.class.relativepath}"/> </pathconvert> {noformat} # extract module name from absolute path of main class {noformat} <loadresource property="module.name"> <propertyresource name="main.class.absolutepath.unix"/> <filterchain> <replaceregex pattern="${run.modules.dir.location.unix}/([^/]+)/.*\.class" replace="\1"/> </filterchain> </loadresource> {noformat} > Java Modular Application Project build fail on Windows OS > --------------------------------------------------------- > > Key: NETBEANS-1788 > URL: https://issues.apache.org/jira/browse/NETBEANS-1788 > Project: NetBeans > Issue Type: Bug > Components: projects - Java 9 MultiModule > Affects Versions: 10.0 > Environment: OS: Windows 10 Pro, 64bit > JDK: OpenJDK 11.0.1 Windows 64bit > NetBeans: 10vc4 > Reporter: TAKAHASHI,Toru > Priority: Major > > h2. Problem > BUILD FAILED to build application project generated from 'Java Modular > Project' > on Windows and include path element begin with 'E'. > {noformat} > compile: > Building jar: D:\work\Essen\dist\com.torutk.essen.jar > To run this application from the command line without Ant, try: > C:\tools\jdk-11.0.1/bin/java -modulepath D:\work\Essen\build\modules > com.torutk.essen.Main > D:\work\Essen\nbproject\build-impl.xml:1218: > java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence > near index 20 > \QD:\work\Essen\build\modules\\E([^\\]+)\Q\\E.*\.class > at java.base/java.util.regex.Pattern.error(Pattern.java:2015) > : > {noformat} > > Error on build-impl.xml is as follows: > {noformat} > <pathconvert property="module.name"> > <fileset dir="${run.modules.dir}" > includes="**/${toString:main.class.relativepath}"/> > <regexpmapper > from="\Q${run.modules.dir.location}${file.separator}\E([^${file.separator.string}]+)\Q${file.separator}\E.*\.class" > to="\1"/> > </pathconvert> > {noformat} > in regexpmapper, if 'run.modules.dir.locaion' includes any directory name > begin with 'E', the 'E' following a file.separator (i.e. '\') is treated as > ends quoting '\E'. > So, trailing '\build' is treated as escape sequence '\b' and string 'uild'. > '\b' is available escape scequence. > Then, trailing '\modules' is treated as escape sequence '\m' and string > 'odule'. > '\m' is illegal escape sequence. > h2. Reproducing Procedure > * [File]menu > [New Project] > [Java Modular Project] > * Name project begin with 'E' (for example, 'Essen') > * Add new module to the project > * Create Main class (with public static void main method)In this steps, > build project is succeed because of no main class is set to the project. > * Run project once.The main class is set to the project. > * Build project, then BUILD FAILED occurrs. > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists