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

Problem with org.bridj.Platform.open() on Windows #306

Closed
Yrlec opened this Issue Apr 21, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@Yrlec

Yrlec commented Apr 21, 2012

When executing org.bridj.Platform.open on Windows it opens the file successfully but also throws a NoSuchMethodException (I am using BridJ 0.6.1). The problem can easily be solved by just returning after calling execArgs in the Platform.isWindows() if-branch.

The code looks like this.

public static final void open(File file) throws NoSuchMethodException {
    if (Platform.isMacOSX()) {
            execArgs("open", file.getAbsolutePath());
    } else if (Platform.isWindows()) {
        if (file.isDirectory()) {
        execArgs("explorer", file.getAbsolutePath());
        } else {
        execArgs("start", file.getAbsolutePath());
    }
--> It should return here.      
}
    if (Platform.isUnix() && hasUnixCommand("gnome-open")) {
        execArgs("gnome-open", file.toString());
    } else if (Platform.isUnix() && hasUnixCommand("konqueror")) {
        execArgs("konqueror", file.toString());
    } else if (Platform.isSolaris() && file.isDirectory()) {
        execArgs("/usr/dt/bin/dtfile", "-folder", file.getAbsolutePath());
    } else {
        throw new NoSuchMethodException("Cannot open files on this platform");
    }
    }
@ochafik

This comment has been minimized.

Show comment
Hide comment
@ochafik

ochafik Apr 21, 2012

Member

Hi @Yrlec ,

Thanks a lot for reporting and diagnosing this issue, I've deployed a fix in 0.6.2-SNAPSHOT

Cheers

Member

ochafik commented Apr 21, 2012

Hi @Yrlec ,

Thanks a lot for reporting and diagnosing this issue, I've deployed a fix in 0.6.2-SNAPSHOT

Cheers

@ochafik ochafik closed this Apr 21, 2012

@Yrlec

This comment has been minimized.

Show comment
Hide comment
@Yrlec

Yrlec Apr 21, 2012

Great! You are as a quick as always!

Yrlec commented Apr 21, 2012

Great! You are as a quick as always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment