hypfvieh / dbus-java

Improved version of java DBus library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/)
https://hypfvieh.github.io/dbus-java/
MIT License
185 stars 73 forks source link

DBusConnection.getConnection error #71

Closed victoryeo closed 4 years ago

victoryeo commented 5 years ago

I use Netbean , i add dbus-java dependency to pom.xml , the version is 3.0.2.

When i call the function below: DBusConnection.getConnection(DBusBusType.SESSION, false, 100000);

There is an error:

no suitable method found for getConnection(DBusBusType,boolean,int) method DBusConnection.getConnection(String,boolean,boolean) is not applicable (argument mismatch; DBusBusType cannot be converted to String) method DBusConnection.getConnection(Supplier,boolean,boolean) is not applicable (argument mismatch; DBusBusType cannot be converted to Supplier)

I check the file, dbus-java/src/main/java/org/freedesktop/dbus/connections/impl/DBusConnection.java there is : public static DBusConnection getConnection(DBusBusType _bustype, boolean _shared, int _timeout)

Why the function does not match ?

hypfvieh commented 5 years ago

What do you try to do? Usually DBusConnection.getConnection(DBusBusType.SESSION); should be enough to create a Dbus user session.

Anyway, the error looks like you trying to call a non-existent method. Is your runtime classpath using the same libraries than the compile time classpath?