Java UI for linuxcnc

More
30 Jun 2021 17:59 #213355 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Awesome! :D Can't wait to play with your app.
Btw, can you read/write hal pins from your java code?
I am using that into QtPyVcp so I assume it should be available in java too.

Please Log in or Create an account to join the conversation.

More
03 Jul 2021 16:50 #213573 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Just pushed changes to github.
Please try again - it should work now.

I use eclipse for project editing and debugging. For runtime-testing I start linuxcnc from a terminal that starts axis in simulation mode. Then I start my app from eclipse.
Running both apps side by side, you can use axis controls and watch java app running, or you can use java controls and watch axis running.
Both are running synchronously.

Have fun

Please Log in or Create an account to join the conversation.

More
04 Jul 2021 10:25 #213655 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Thanks for your hard work!
Just pulled the code, set up the dependencies, made the build, trying to get it running. I am using IntelliJIdea as an IDE.
The error I get when I try to run the app is:

local check: AppTitle == > JCNCScreen - frontend for linuxCNC <
populateTree ...
read ToolTable ...
Exception in thread "main" java.lang.UnsatisfiedLinkError: no linuxcncini in java.library.path: [/usr/java/packages/lib, /usr/lib/x86_64-linux-gnu/jni, /lib/x86_64-linux-gnu, /usr/lib/x86_64-linux-gnu, /usr/lib/jni, /lib, /usr/lib]
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at de.schwarzrot.system.ErrorReader.<clinit>;(ErrorReader.java:176)
at de.schwarzrot.app.LinuxCNCClient.<init>;(LinuxCNCClient.java:122)
at de.schwarzrot.app.LinuxCNCClient.main(LinuxCNCClient.java:494)

I have noticed that the ErrorReader class tries to load the following libraries.

static {
System.loadLibrary("linuxcncini");
System.loadLibrary("nml");
System.loadLibrary("linuxcnchal");
System.loadLibrary("LinuxCNC");
}

In the project I can see a folder named lc with symlink to the folder where linuxcnc was build from sources. Inside lc/lib folder I can see that it contains these libraries but all of them have lib in front of their names. See the attached screenshot. 
If you have any ideas what I'm doing wrong..please let me know.
Attachments:

Please Log in or Create an account to join the conversation.

More
04 Jul 2021 11:38 #213658 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Did you built the project using ant?
or did you built it from IntelliJ?

If the later is true, you'll need to issue a "make" in native directory.

When you use ant, it will create a directory "runtime", from which start of the app should work. Below "runtime" you'll find a directory "misc" which contains a script, which includes the runtime parameters to start JCNCScreen.

Eclipse puts the compiled binaries into different locations, so eclipse needs different startup options too. May be its similar for IntelliJ?
On eclipse I have set the working directory to the path where eclipse puts the binaries, then I have VM-arguments
-Djava.library.path=${workspace_loc:UI4LinuxCNC}/native:${workspace_loc:UI4LinuxCNC}/native/lc/lib
-splash:${workspace_loc:UI4LinuxCNC}/native/lc/linuxcnc.gif
and finally I have application parameters set to:
portrait
-base ../exHdr
-theme rma

Please Log in or Create an account to join the conversation.

More
04 Jul 2021 12:31 #213670 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
I was running from the IntelliJ, I've issued that make command and now some more files have appeared to that native folder.
Then I tried running ant dist from terminal, being in the JCNCScreen folder. Here is the output that I get.
Indeed the native folder does not contain any "build.it" file.
What I'm I missing?
Attachments:

Please Log in or Create an account to join the conversation.

More
04 Jul 2021 12:35 #213671 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
I changed native stuff from hardcoded build script to makefile and forgot to change ant-script.
Just issue a "git pull" and it should work.

Please Log in or Create an account to join the conversation.

More
04 Jul 2021 13:16 #213683 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Indeed it worked, it went a bit further but the zip was not yet created.

vasilemihalca@INV1047:~/Geeking/JCNCScreen$ ant dist
Buildfile: /home/vasilemihalca/Geeking/JCNCScreen/build.xml

clean:

build:
[javac] /home/vasilemihalca/Geeking/JCNCScreen/build.xml:40: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 153 source files to /home/vasilemihalca/Geeking/JCNCScreen/build
[javac] warning: [options] bootstrap class path not set in conjunction with -source 8
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning
[exec] make: Nothing to be done for 'all'.
[copy] Copying 49 files to /home/vasilemihalca/Geeking/JCNCScreen/build

dist:
[jar] Building jar: /home/vasilemihalca/Geeking/JCNCScreen/runtime/JCNCScreen.jar
[zip] Building zip: /home/vasilemihalca/Geeking/JCNCScreen/JCNCScreen-bin.zip

BUILD FAILED
/home/vasilemihalca/Geeking/JCNCScreen/build.xml:88: Problem creating zip: /home/vasilemihalca/Geeking/JCNCScreen/runtime/exHdr

Total time: 3 seconds

Please Log in or Create an account to join the conversation.

More
05 Jul 2021 02:21 #213735 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Did you built LCExportHandler before JCNCScreen as mentioned in the Readme?

Please Log in or Create an account to join the conversation.

More
05 Jul 2021 05:52 #213745 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Yes, the LCExportHandler.jar was copied automatically to the lib folder.

Please Log in or Create an account to join the conversation.

More
05 Jul 2021 14:15 - 05 Jul 2021 14:16 #213763 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Oh - I have no idea.
Did you run out of disc space?
Don't know - never had problems creating zip file.

I just removed the exHdr directory as well as the runtime directory and ant created the zipfile without issue.
I guess, in your home directory you have full write permissions ...

Don't know what happened.
You can look at build.xml file. There's no secret about creating zipfile.

May be you should issue a "ant clean" followed by "and dist"?
Last edit: 05 Jul 2021 14:16 by Reinhard.

Please Log in or Create an account to join the conversation.

Time to create page: 0.143 seconds
Powered by Kunena Forum