Giter VIP home page Giter VIP logo

Comments (3)

hypfvieh avatar hypfvieh commented on August 16, 2024

First of all, you don't have to build it yourself because 3.0.2 is available in maven central, so you can just add it to your maven/gradle project.

The reason for the duplicated make files is the maven build process.
Maven copies everything from src/main/resources to target directory.

I thought, these libraries are part of the old implementation (2.7.x versions), which in turn in not compatible (according to the README.md file) with this library.

The comment in README.md means only the java code and not the c code.
The binaries (the c library to create unix sockets) is still the old original version.

This should inform developers that they have to change their code to be able to use the new library version (=> not a drop-in replacement).

If you want to build the native libs yourself, you have to build the code in src/native e.g. using the compile_native.sh shell script. GCC and some other dev-libs/headers are required to do this.

from dbus-java.

LotekB avatar LotekB commented on August 16, 2024

from dbus-java.

hypfvieh avatar hypfvieh commented on August 16, 2024

I still don't understand why you want to compile everything yourself, when you are just interested in running the interface creation tool.

Anyway, this is how you compile the native library:

  1. make sure you have JAVA_HOME environment variable set to your JDK directory (at least Java 8 required)
  2. make sure you have gcc and make installed
  3. Go into the directory of your cloned 3.0.2 dbus-java repo
  4. Change directory to subproject 'dbus-java'
  5. Use mvn compile to create the required class files
  6. Change directory to subproject dbus-java/src/native
  7. Call compile_native.sh like this:
    sh compile_native.sh /tmp $(readlink -f ../../) $(readlink -f ../../target/classes/)

This will create the native library in /tmp/native

Regarding your questions:
The libraries from matthew.ath.cx (Matthew Johnson) are not required at all.
In version 3.0.2 dbus-java already contains the classes from the libunix-java project of Matthew
Johnson.

In fact dbus-java is a fork of the dbus-java implementation from matthew.ath.cx because the original library was written for Java 5 and was never uploaded to Maven Central.
The original lib was also never updated for the last 10 or 15 years, so I took over to put it to some better shape and make it available in Maven Central as the original was never uploaded.

The only thing where the original lib comes into play is when you install libunix-java using your package manager on linux (e.g. apt on debian/ubuntu).
Then a ready-to-use version of the library with the required native libs is installed.
dbus-java will then use this native-library instead of the compiled native lib provided in src/main/resources/lib.

But again, if you just want to use the createInterface tool, just use the maven artificats like this:

  1. download the dbus-java artifact from here.
  2. download the dbus-java-utils from here
  3. download slf4j-api from here
  4. optional: download slf4j-simple to get more/better logging (find it here)
  5. put all files into the same directory
  6. open a shell and switch the directory you put all the files in
  7. Run java:
    java -cp dbus-java-3.0.2.jar:dbus-java-utils-3.0.2.jar:slf4j-api-1.7.25.jar:slf4j-simple-1.7.26.jar org.freedesktop.dbus.bin.CreateInterface

You have to add some more parameters after the CreateInterface class name to provide the required information for the util for creating the interface files of your desired dbus object.

from dbus-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.