Skip to content

qbancoffee/drivewire4

Repository files navigation

DriveWire 4

DriveWire 4 Java by Aaron Wolfe

This repo holds two netbeans projects for two versions of DriveWire 4 by Aaron Wolfe that have been slightly modified so that they can be compiled and run with newer versions of java.

Compiling

To compile and run, make sure you have:

  • A JDK installed, I used OpenJDK 17 but any other JDK should work as well.
  • ant
  • NetBeans 16 or higher. For use on ARM64 you'll need to compile a small shared library so you'll need.
  • g++
  • X11 development headers

With ant installed, navigate to the project directory "drivewire4/drivewire4_from_source" and type the following to compile:
ant

Depending on the version of ant you have this step might produce an error. you'll see something like the following.

BUILD FAILED
/home/rockyhill/Downloads/src/drivewire4/drivewire4_from_source/nbproject/build-impl.xml:1560: /home/rockyhill/Downloads/src/drivewire4/drivewire4_from_source/build/test/classes does not exist.

to solve this all you need to do is create test/classes directory inside of the newly created build directory. on linux you can issue the following command.

mkdir -p build/test/classes

Run the ant command again.

ant

If you are going to run this on a raspberry pi that uses the X11 windowing system, then you'll need a small library that calls XInitThreads(). In order to use SWT, XInitThreads() needs to be called beforehand. For whatver reason, SWT does not take care of this so we must. I found and modified a small library "xdll.cpp" that someone made to solve this issue and it can be found in drivewire4/drivewire4_from_source

Make sure you are compiling this on a raspberry pi and and that you have the X11 develeopment headers and g++ installed. to compile issue the following command. You can also cross compile this for arm64 from your dev computer but I haven't tried that yet.

g++ -o libx.so -shared -fPIC -Wl,-soname,libx.so -L/usr/lib/X11 -I/usr/include/X11 xdll.cpp -lX11

Copy the newly created shared library "libx.so" to "drivewire4/drivewire4_from_source/lib"

Yo can now start DriveWire 4 using the included script for arm64.

./drivewire4_linux_arm_64

For the drivewire4_from_source project use the script for your Operating system after compiling.

  • drivewire4_linux_x86_64
  • drivewire4_linux_arm_64
  • drivewire4_windows_x86_64.bat
  • drivewire4_mac_x86_64

For the drivewire4_decompiled version.

java -jar dist/drivewire_decompiled.jar
Error: Unable to initialize main class com.groupunix.drivewireui.MainWin
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout

  • drivewire4_decompiled is a version of the sources obtained from the decompilation of DW4UI.jar.

Watch this video to see how the sourceforge version was modified to compile and run with Java 17.

Ant uses "nbproject/private/private.properties" to get the path to the JDK from NetBeans. In my case "user.properties.file=/home/rockyhill/snap/netbeans/74/build.properties".
This is quickly solved by either updating that path manually or opening the project in NetBeans and building once. This is a minor annoyance but it's solvable.
After running it, you'll notice that the UI is very differnt from the UI that one sees when running the latest version of DriveWire 4. I suspect this might be a version isssue so hopefully someone will have the source for that and one day this repo can be updated. See screenshots of the UI below.

Screenshots


Main UI on Windows 10 64 bit de-compiled version.


Main UI on Linux 64 bit de-compiled version.


Main UI on 64 bit linux sourceforge version.


Lite UI on 64 bit linux sourceforge version.