Using Janino Compiler with Drools to get round Java 8 wrong class format error

Add -Ddrools.dialect.java.compiler=JANINO to Java VM options e.g.  -ea -Ddrools.dialect.java.compiler=JANINO Add Janino to maven dependencies

Advertisements

Package JavaFX App for the Mac App Store

Yes, it's possible to compile your JavaFX code as a native app, and then code sign it and submit it to the Mac App store. Package your JavaFX App Here are a couple of great links: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html https://gist.github.com/jewelsea/5018976 The Shell Script to Package your Code

Drools6.1 and JavaFX8 with Java8 – Genealogy Rules

I wanted to create a simple project that integrated Drools6.0 with JavaFX8 using Java8 and some of its new features.  So, here goes. Objective We are going to go back to one of the classic problems of Genealogy.  You're tracing your family tree and you've found hundreds of people who could be related but matching … Continue reading Drools6.1 and JavaFX8 with Java8 – Genealogy Rules

Using JavaFX8 to Drag Connected Shapes

Objective In this example we are going to create three connected circles as per the image below: and we will be able to drag these circles around the screen using the mouse: The Code Create the class examples001.ConnectedShapes.java as follows: ConnectedShapes Run the code by right clicking on the file and selecting Run File. Reviewing the … Continue reading Using JavaFX8 to Drag Connected Shapes

Using JavaFX to draw a Changing Shape

Objective In this example we are going to create a RoundedRectangle shape with two sliders as per the image below: By moving the slider inside the shape, we will change the curvature on the corners of the shape: By moving the slider underneath the shape, we will move the shape (and the slider within it) … Continue reading Using JavaFX to draw a Changing Shape

Create a Default JavaFX8 Application

To create tje JavaFX Examples I am going to use Netbeans 8 with Java 8. Create a JavaFX Project Open NetBeans File -> New Project -> JavaFX -> JavaFX Application Project Name: JavaFX8Examples JavaFX Platform: JDK 1.8 (Default) This will create and open the file javafx8examples.JavaFX8Examples.java JavaFX8Examples Run the Application To run the code either … Continue reading Create a Default JavaFX8 Application

Java 8 and Lambda to Search a File

In this example we are going to read from a File and use Lambda expressions to  search out and collect every line that contains a .foreach statement. Search Within a File Note that we are also using Java NIO and try-with-resources which makes use of the AutoCloseable interface. Source Code Full source code of a … Continue reading Java 8 and Lambda to Search a File