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

watchJars在windows中Bug #145

Closed
kevin70 opened this issue Sep 11, 2015 · 1 comment
Closed

watchJars在windows中Bug #145

kevin70 opened this issue Sep 11, 2015 · 1 comment

Comments

@kevin70
Copy link

kevin70 commented Sep 11, 2015

TypeRegistry.java

if (GlobalConfiguration.jarsToWatch != null) {
    // 1.3 feature, can watch jars!
    String urlstring = url.toString();
    // example path: jar:file:/var/folders/cn/p3n4rh_n6z7gm6zwk53mtfc80000gp/T/_sl308369570226517394/foo.jar!/Foo.class
    int bangSlash = urlstring.lastIndexOf("!/");
    if (bangSlash != -1) {
        String pathInJar = urlstring.substring(bangSlash + 2);
        String remainingPrefix = urlstring.substring(0, bangSlash);
        int lastSlash = remainingPrefix.lastIndexOf(File.separator);
        String jarname = remainingPrefix.substring(lastSlash + 1);
        for (String jarToWatch : GlobalConfiguration.jarsToWatch) {
            if (jarname.equals(jarToWatch)) {
                reloadable = true;
                jarEntry = true;
            }
        }
    }
}

Jar路径
jar:file:/var/folders/cn/p3n4rh_n6z7gm6zwk53mtfc80000gp/T/_sl308369570226517394/foo.jar!/Foo.class

int lastSlash = remainingPrefix.lastIndexOf(File.separator);

windowsFile.separator为"**". 配置的jarnamefull path**. 导致jarname.equals(jarToWatch)永远为false.

@ksfzhaohui
Copy link

我也遇到这个问题,你linux上可以用吗

@kevin70 kevin70 closed this as completed Sep 7, 2018
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

No branches or pull requests

2 participants