I hope everyone stay safe and well in the unprecedented Pandemic.
Recently I stumbled upon Fantom, and very exited about it.
I installed the F4 IDE in my Linux box, together with Zulu OpenJDK8 (https://cdn.azul.com/zulu/bin/zulu126.96.36.199-ca-jdk8.0.282-linux_x64.zip)
Now trying to run a few examples from the fantom official release. While others are working as expected, but I got some errors with demo.fan (fantom-1.0.75/examples/fwt/demo.fan)
F4 IDE->Console tab <terminated> demo.fan [Fantom Script] /app/zulu8/bin/java (Feb, 15..
sys::NullErr: Coerce to non-null
I appended some libs in the build.fan
depends = [
Java is also an alien language to me(mostly C, HDL like Verilog/VHDL :-), I'm trying to get a clue what I'm missing here.
It would be much appreciated if someone in this forum helps me out.
BTW, Is there any plan to bundle swt.jar to the next official release for the fan.platform: linux-x86_64? (F4 IDE has it by default: f4/plugins/com.xored.f4.fantom_188.8.131.52005161116/fantom/lib/java/ext/linux-x86_64/swt.jar)
The offending line in demo.fan is:
File scriptDir := File.make(this.typeof->sourceFile.toStr.toUri).parent
Which tells me demo.fan it is expecting to be run as a Fantom script (from from the cmd line), not as a proper pod project which F4 runs Fantom as.
That variable scriptDir does not seem to be used anywhere, so just try commenting out that line (demo.fan:638) and try again.
As for SWT for linux 64, probably not any time soon... here's a post from 12 years ago asking the same!
A couple of (slightly) more recent download links are available from the article FWT on 64-Bit Platforms - but it sounds like you've already got that sorted.
Have fun, Steve.
Thanks for the tip!
However, I met another error: sys::Err: org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
I'm not the only one, https://stackoverflow.com/questions/7130980/swt-browser-no-more-handles-error
I think this is an environmental issue, the shipped version of SWT/XULrunner might be a culprit.
I'll be hanging around a bit more on this.
By the way, I've enjoyed your short video clips/articles about the awesome language, Fantom/ F4 IDE. All is really helpful and fun!
Thank you so much.
Further testing ended up with core dump:
# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0000000000000000, pid=848239, tid=0x00007fa93d4bc640 # # JRE version: Java(TM) SE Runtime Environment (8.0_172-b11) (build 1.8.0_172-b11) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.172-b11 mixed mode linux-amd64 compressed oops) # Problematic frame: # C 0x0000000000000000 # # Core dump written. Default location: /home/woody/f4workspace/Examples/core or core.848239 # # An error report file with more information is saved as: # /home/woody/f4workspace/Examples/hs_err_pid848239.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug.
Just for record, I'd gone through the following steps:
In addition to the blank dialog, one of the following errors may appear in the log (<user home>/rcphelp/workspace/.metadata/.log):
org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME='/usr/lib/mozilla'] (java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3452 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file)
libxpcom.so => not found
ok all library-missing-errors gone,
but finally core dumped regardless of JDK used; with Oracle JDK1.8.0/JRE1.8.0(hotspot), and with Azul Zulu8 JDK, too.
$ tree -L 1 /app /app ├── _f4 ├── f4ide # F4 IDE ├── f4.sh ├── _fan ├── fantom # not used, but copied the examples of fwt demo ├── hotspot8 # Oracle hotspot JRE ├── lost+found ├── xulrunner └── zulu8 # Azul zulu8 JDK
The environment variables I set:
$ $ cat /app/_f4 #!/bin/sh
#JAVA_HOME=/app/zulu8 JAVA_HOME=/app/hotspot8 F4_HOME=/app/f4ide
# stop flickering ; or env SWT_GTK3=0 F4 & SWT_GTK3=0 unset GTK_IM_MODULE MOZILLA_FIVE_HOME=/app/xulrunner
env SWT_GTK3=0 F4 &
export JAVA_HOME F4_HOME SWT_GTK3 MOZILLA_FIVE_HOME PATH LD_LIBRARY_PATH
$ cat /app/f4.sh #!/bin/sh
. /app/_f4 env SWT_GTK3=0 F4 -clean &
-- The end of the story today.
The bottom line is that the Eclipse seemed to have hard-coded Web libs(XULrunner), which is not available from the latest offering of 78ESR version in 2021 Simply version got incompatible.
Linux box used is Mageia 8.0rc Plasma.
The end of story, but I can try it again in a Windows box later.
That sounds like quite the rabbit hole you went down there! I develop on Windows so I'm afraid I'm not much help here.
But are you trying to use the bundled fwt::WebBrowser or still just running demo.fan?
If using WebBrowser, that did have some issues, even on Windows, but I fixed them in my own Browser widget in the Reflux library. I believe you should be able to use afReflux::Browser widget as a drop in replacement for fwt::WebBrowser (without actually using Reflux) - but it's been a whilte since I tried it.
Yes, I'm trying out the bundled demo.fan. It's just for sanitiy check. I would like make sure the basic function should work in my Linux box.
While it's still failing on F4 IDE, I'm happy to report that it's working now with commandline of the official latest fantom release.
I'm writing this inside the demo after logging into this forum.
the title of window : 'FWT Demo' -> 'WebBrowser' tab -> address: 'http://fantom.org' Enter to Go!
It's pretty amazing!
I start to think that I should introduce this SUPER COOL Fantom language to my kids as their first programming language.
Thank you all for making this masterpiece All kudo goes to Brian, Andy, Steve and all other contributors!
I feel I'm a bit late to the party ;-)
I'm learning a bit about Pandoc :-)
Login or Signup to reply.