View Single Post
  #11  
Old 08.05.2014, 19:47
Enqueue90
Guest
 
Posts: n/a
Default

So far I didn't manage to get JD2 running without GUI on my Synology. Mostly my problems are that the Java classes try to load native libraries which are note available. I am still trying to build workarounds which makes Java think everything's fine and there's a GUI. An example: Direct in the java.awt.Toolkit static initializer Java tries to load the libawt. This static lib has a dependency on libXext which is not available in the Synology Java installation.

So far I'm a bit stuck because the places where those exceptions happen are really bad and don't allow proper handling.

[EDIT] My next try will be to implement the platform abstraction one layer deeper on native level: The libawt. Maybe I can manage to compile my own no-gui libawt which has no dependency on XServer.

[EDIT2] Good news: I finally managed to get a combination of Java and Native code which allows me starting a Swing/AWT application without a UI available on the host system. Those are the steps so far:
  • I created an own AWT Toolkit which acts like there was a UI available.
  • I created an own AWT GraphicsEnvironment to simulate all the Java2D drawing stuff. No actual drawing is done and only empty buffers are created. I hope JDownloader does not do any drawing mechanisms.
  • Last but not least I created an own native AWT library (dll/so). This library implements all JNI methods which are required by the AWT classes.

The next problem will be to compile this AWT library for my Synology. The toolchain is only available for Linux so I'll have to check if I can setup a VM for this problem.

[EDIT3] Again some progress: Managed to compile my own AWT library for Synology and passed a lot of AWT object creations. The next problems are on Swing level. They often directly call non standard Java (sun.*) classes for internal operations like Font loading. The next step will be to create custom empty implementations for those classes.

Last edited by Enqueue90; 18.05.2014 at 22:09.
Reply With Quote