Is it possible to use JDK11 modules from Groovy? (even if I have to use Groovy 3 alpha) - javafx

Is there a way in Groovy to import code from JDK11 modules such as javafx? So far, groovyc fails to compile, hitting an error when it imports the JavaFX module's code. I can't even get a HelloWorld groovy script to compile if it imports JavaFX.
A command such as this fails:
./groovy3/groovy-3.0.0-beta-2/bin/groovyc grscript.groovy -j -Fmodule-path=/usr/share/openjfx/lib/ -Fadd-modules=javafx.controls:javafx.base
Gives the error:
unable to resolve class javafx.application.Application
# line 2, column 1.
import javafx.application.Application;
^
Equivalent HelloJFX.java works just fine. Thus I know everything in OpenJDK11 and OpenJFX is working fine. It's just the Groovy side of things that is broken.
I am using OpenJDK11 and OpenJFX on Linux, Debian Buster. I've tried the stable version of Groovy and also the newest alpha of Groovy 3.
I can find almost no information online/anywhere about using Java 11 modules in Groovy.
If the answer is simply "No version of Groovy can use JDK11's modules such as JavaFX" I'd simply like to know.
Any other ideas very welcome. Thanks for reading.

You could try to put the JavaFX jars on the classpath instead of the modulepath and
then add a line like this to your program.
class MyProgramLauncher {public static void main(String[] args) {MyProgram.main(args);}}
The program must then be launched via this launcher class to make this work.
I don't know what the equivalent for this line is in Groovy but I am sure you can figure that out. I do this all the time in order to avoid all these module system headaches and so far it has never failed.

An upcoming release is planning to solve this issue. (The version 3 series, which is pre-release now.) I'll wait for it to be released as final and then try again.
JDK 11 is known not to work in earlier Groovy versions. In fact Groovy 3 is advertised as being JDK8+ compatible. (Website today says: "Groovy 3.0 is a bleeding edge version of Groovy designed for JDK8+ and with the new Parrot parser enabled by default. Pre-stable versions are available".)

Related

OpenFlipper fails to compile, unable to find Qt

On its website OpenFlipper says it can be compiled in three steps as:
cd build
cmake ..
make # or, even better, make -j8
However I get an error saying Qt is unable to be found at the cmake step and that I should specify a QT5_INSTALL_PATH. However even if I do this OpenFlipper is still issuing the same complaint!
You are not supposed to specify where Qt is installed in the QT5_INSTALLED_DIR but prior to that as environment variable in your terminal:
# assuming Qt was installed in your home directory, as is default
export CMAKE_PREFIX_PATH=~/Qt5.7.0/5.7/gcc_64/
# note that you now have to call cmake etc from that process
Compiling and running it after that you might get errors telling you GL_ARB_vertex_buffer_object is not present, even if your glxinfo | grep ARB_vertex_buffer is telling you it is.* Clicking "Ignore" results in a crash. To mitigate this, you have to manually change (4,3) to (3,0) in
OpenFlipper/widgets/coreWidget/CoreWidget.cc
If you still experience errors, try deleting your cmake cache, this is accomplished by using cmake-gui (was in the package cmake-qt-gui for me) and hitting "Delete Cache"
(optional) remove the very annoying warning message you get at every start of OpenFlipper by removing the line concerning "renderers shipped" in
OpenFlipper/Core/Core.cc
*: My teaching assistant told me that there is a bug in Qt (<5.9) that forces OpenFlipper to use the OpenGL Compatibility Profile. Additionally Intel and AMD drivers hand back an OpenGL 3.0 Core Context when asked for an OpenGL 4.3 Compatibility Context (my TA described this behavior as a "bug", I'm not so sure about this), leading to a crash in Qt. So this should be resolved in Qt 5.9 (not out yet). This seems to affect also mainly integrated graphics, so one could try using a dedicated GPU.

Can't run qt commands like qtviewer

I am new to Qt so I follow a tutorial on QML. It starts with a basic qml file which should be run with qmlviewer.
The problem is that when I start qmlviewer it says
qmlviewer: could not exec '/usr/lib/qt/bin/qmlviewer': No such file or directory
whereis qmlviewer tells me that it's location is /usr/bin/qmlviewer so I try to run it with this absolute path, but I still get the same error
qmlviewer: could not exec '/usr/lib/qt/bin/qmlviewer': No such file or directory
Why is it still looking for that location ? How can I solve this ?
I should mention that I have tried qtconfig just for testing, and I still get the error, so this is a global Qt problem.
Thank you
As said in the documentation : http://doc.qt.io/qt-5/qtquick-porting-qt5.html
The qmlviewer tool provided for prototyping and testing QML
applications in Qt 4.x has been replaced with the qmlscene tool which
integrates with the new scenegraph features in Qt 5.
So using qmlscence all works.

Unable to import DateTime library in Robot Framework

I want to use keywords written in DateTime Library
http://robotframework.googlecode.com/hg/doc/libraries/DateTime.html?r=2.8.5
I have robot framework 2.8.6.
Whenever I import this library in my tests in RIDE; it is shown in red (not resolved). Also in documentation I am not able to search the keywords.
Your problem is probably with RIDE and not Robot Framework. RIDE uses its own copy of RF regardless of what you have installed. The included version is out of date. Try copying DateTime.py from Robot Framework installation to the folder in RIDE.
For example, copy C:\apps\Python27\Lib\site-packages\robot\libraries\DateTime.py to
C:\apps\Python27\Lib\site-packages\robotide\lib\robot\libraries
Then restart RIDE.
ombre42 is right, RIDE (my current is 1.3.0) includes an older version of RobotFramework which does not includes DateTime module. You have the RobotFramework 2.8.6 installed, but you doesn't use it when you launch tests using RobotFramework-RIDE.
Two important things:
Copy DateTime.py from your RobotFramework 2.8.6 as ombre42 said, but don't import DateTime using pip: it will work but you'll not get the RobotFramework's one (which is better and documented).
When you run your tests outside of RIDE, in a Jenkins environment for example, you'll probably use the RobotFramework 2.8.6 (or later) and not the same as your RIDE environment.
I'm use RF with Python and by default my IDE sees Python DateTime library.
Use full path:
Library robot.libraries.DateTime

Compile Java source to LLVM IR [duplicate]

From what I've read, there is a llvm program that converts java bytecode to llvm's intermediate form called class2llvm. My question is, how do I access this. What front end do I have to install in order to access this.
VMkit is their implementation of a JVM, but I am looking for how to compile the java source code with llvm, not how to run it.
The Java frontend translates Java bytecode (.class files) into LLVM
bytecode. Take a look at this link:
https://llvm.org/svn/llvm-project/java/trunk/docs/java-frontend.txt
You may take a look at dragonegg, which enables llvm to use gcc's frontends. As gcc already has a frontend for java, called gcj, perhaps llvm can use it to compile java code. But I'm not sure how well llvm interfaces with the gcc frontend, so this may not work.
I have executed a java class using vmkit ( http://vmkit.llvm.org/ ) based on LLVM. It uses LLVM for compiling and optimizing high-level languages to machine code. J3 is an implementation of a JVM with VMKit.
[NOTE: From November 2015 it is no longer open source, so this hack is mostly useless.]
RoboVM might become the solution you're looking for. It's open source and compiles JVM bytecode (.class files) to machine code.
I assume they do it using something like class2llvm.
Unfortunately, it's still in alpha. I just tested it on HelloWorld.java. It gave 5x speed up of load time running on a single core. (Most of the run time is load time.)
echo Hello World! : <1 ms : 31K (/usr/bin/echo binary)
java HelloWorld : ~70 ms : 0.4K (HelloWorld.class JVM bytecode)
./HelloWorld : ~13 ms : 9.4MB (9.3MB binary + 57K robovm-rt.jar)
Note that java calls a 32MB $JAVA_HOME/lib/rt.jar file (and maybe more). Searching in such a large file must be part of the reason java is so slow to load. If RoboVM gets smarter, perhaps it can throw out most of the 9.3MB binary for an even faster load?
The website mentions iOS, but I think that's because they're selling their add-on UI libraries. RoboVM compiled fine for me on a flavor of Ubuntu. Just make sure to do
$ sudo apt-get install g++-multilib
first (and maybe install libpthread-stubs0-dev and libpthread-workqueue0...don't know if they mattered).

adobe brackets-shell : cef extract failed

I followed all the step is mention in given below url to build my project( I am using win7 OS).
https://github.com/adobe/brackets-shell/wiki/Building-brackets-shell.
actullly i want to create brackets installer (installed wix 3.7).
but i am getting cef-extract failed error.
even though i also used grunt cef-extract --force.
after that its throunging new error.
create -project failed after that i am not able to process further.
can some one help me.
thanks in advanced.
Regards
ashish .
If you include the exact console output you're seeing, it would be much easier to help you. But based on snags other people have encountered recently, you can try these things:
Make sure your PATH includes Python 2.7 (otherwise "create-project" will fail).
Delete all these folders to be sure you're starting from a clean slate: deps, Debug, include, libcef_dll, Release, Resources.
Just run the high-level tasks grunt setup and grunt build, following the Building brackets-shell instructions. (There's a known bug where grunt cef-extract fails when run standalone).

Resources