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

Error parsing commandline module path in Windows #10

Open
gimmi opened this issue Sep 27, 2011 · 1 comment
Open

Error parsing commandline module path in Windows #10

gimmi opened this issue Sep 27, 2011 · 1 comment
Labels
CommonJS Issues related to the CommonJS implementation in Rhino docs Issues containing stuff that ought to be documented

Comments

@gimmi
Copy link

gimmi commented Sep 27, 2011

The command:

java -cp js.jar org.mozilla.javascript.tools.shell.Main -modules "C:\Users\Gimmi\Sources\jsmake\"

Throws this rerror on Windows:

Exception in thread "main" java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path at index 5: Users\Gimmi\Sources\jsmake
        at org.mozilla.javascript.tools.shell.Global.installRequire(Global.java:182)
        at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:131)
        at org.mozilla.javascript.Context.call(Context.java:521)
        at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
        at org.mozilla.javascript.tools.shell.Main.exec(Main.java:198)
        at org.mozilla.javascript.tools.shell.Main.main(Main.java:174)
Caused by: java.net.URISyntaxException: Illegal character in path at index 5: Users\Gimmi\Sources\jsmake
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3024)
        at java.net.URI.(URI.java:578)
        at org.mozilla.javascript.tools.shell.Global.installRequire(Global.java:170)
        ... 5 more

This command instead seems to work (note the "" replaced with "/"):

java -cp js.jar org.mozilla.javascript.tools.shell.Main -modules "file:///C:/Users/Gimmi/Sources/jsmake/"
@p-bakker p-bakker added the CommonJS Issues related to the CommonJS implementation in Rhino label Jun 29, 2021
@p-bakker p-bakker added the docs Issues containing stuff that ought to be documented label Feb 8, 2023
@p-bakker
Copy link
Collaborator

p-bakker commented Feb 8, 2023

As the module directory needs to be an URI it is expected that file:///C:/Users/Gimmi/Sources/jsmake/ works and C:\Users\Gimmi\Sources\jsmake\ doesn't, as the later isn't a URI, see https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax

Leaving this open and tagged with docs to include this in the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommonJS Issues related to the CommonJS implementation in Rhino docs Issues containing stuff that ought to be documented
Projects
None yet
Development

No branches or pull requests

2 participants