rahmanusta / open

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open for Java

This is a port of https://www.npmjs.com/package/open / https://github.com/sindresorhus/open to Java

Why?

Java lacks a sensible way of opening URLs and applications in a cross platform way. The built in jawa.awt.Desktop only works on some platfors and has some known issues e.g. when the process is run as headless but you still want to use open.

Usage

Add the dependency, e.g. if you are using Maven:

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>open</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Then call one of the static methods in the Open class, e.g.

Open.open("https://github.com/");

opens the URL in the default browser

Open.open("https://github.com/", App.FIREFOX);

opens the URL in the default browser

About

License:Apache License 2.0


Languages

Language:Java 46.8%Language:Shell 42.7%Language:JavaScript 10.6%