Skip to content

Commit 2b67d10

Browse files
author
Aliaksandr.Shpak
committed
- Fix for java 11
1 parent 3cb3268 commit 2b67d10

File tree

5 files changed

+58
-19
lines changed

5 files changed

+58
-19
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# kafka_data_viewer
2-
Desctop UI Tool that providing ability to read and publish kafka records.
2+
3+
Desktop UI Tool that providing ability to read and publish kafka records.
34

45
# Description
56

@@ -19,17 +20,32 @@ Supported formats are:
1920
- GZIP
2021
- Avro
2122

23+
# Download
24+
25+
The read-to-use bundle can be downloaded at github releases page:
26+
27+
https://github.com/alshpak/kafka_data_viewer/releases
28+
2229
# How to run
2330

2431
`java -jar <jar_name> [-n defaultGroupName]`
2532

2633
# Java 11 support
2734

28-
The tool is implemented on JavaFX.
35+
The tool is implemented on JavaFX that is not part of Java 11 anymore.
36+
37+
In order to run it on Java 11 and you need to add JFX module in command line:
38+
39+
**Download JavaFX SDK**
40+
41+
Link to OpenJFX: https://openjfx.io/
42+
43+
Link to Download: https://gluonhq.com/products/javafx/
44+
45+
**Run program with JavaFX module**
2946

30-
In order to run it on Java 11 and later follow the instruction:
47+
`java --module-path <path.to>/javafx-sdk-11/lib/ --add-modules=javafx.controls -jar <jar_name> [-n defaultGroupName]`
3148

32-
- Download JavaFX - https://gluonhq.com/products/javafx/
49+
The example on windows
3350

34-
- Run program with JavaFX module\
35-
`java --module-path <path.to>/javafx-sdk-11/lib/ --add-modules=javafx.controls <package.name>.JavaFX11 -jar <jar_name> [-n defaultGroupName]`
51+
`java --module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" --add-modules=javafx.controls -jar kafka_data_viewer-all-<version>.jar`

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ classes {
5858

5959
sourceSets {
6060
main {
61+
java {
62+
srcDirs = ['src/main/java']
63+
}
6164
scala {
6265
srcDirs = ['src/main/scala']
6366
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version = 0.1.4
1+
version = 0.1.5
22
url = https://api.github.com/repos/alshpak/kafka_data_viewer/releases/latest
33
update_url = https://github.com/alshpak/kafka_data_viewer/releases
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package devtools.lib.rxui;
2+
3+
import java.util.function.Consumer;
4+
5+
import javafx.application.Application;
6+
import javafx.stage.Stage;
7+
8+
public class FxApp extends Application {
9+
10+
public static Consumer<Stage> appRunner;
11+
12+
@Override
13+
public void start(Stage primaryStage) throws Exception {
14+
appRunner.accept(primaryStage);
15+
}
16+
17+
public static void main(String[] args) {
18+
launch();
19+
}
20+
}

src/main/scala/devtools/lib/rxui/FxRender.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import javafx.stage.{Modality, Stage, StageStyle}
2626

2727
import devtools.lib.rxext.ListChangeOps.{AddItems, InsertItems, RemoveItemObjs, RemoveItems, SetList}
2828
import devtools.lib.rxext.{Observable, Subject}
29+
import devtools.lib.rxui.FxRender.primaryStage
2930

3031
object FxRender {
3132

@@ -709,7 +710,17 @@ object FxRender {
709710
override def runApp(root: UiWidget, postAction: UiRenderer => Unit = null): Unit = {
710711
FxRender.rootContent = root
711712
FxRender.postAction = postAction
712-
LauncherImpl.launchApplication(classOf[App], Array())
713+
//LauncherImpl.launchApplication(classOf[App], Array())
714+
FxApp.appRunner = (primaryStage: Stage) => startApp(primaryStage)
715+
FxApp.main(Array())
716+
}
717+
718+
def startApp(primaryStage: Stage): Unit = {
719+
FxRender.primaryStage = primaryStage
720+
val rootContent = FxRender.renderers.renderer(FxRender.rootContent)(FxRender.renderers).render()
721+
applyContentToState(rootContent, primaryStage, fullScreen = true)
722+
primaryStage.show()
723+
if (postAction != null) postAction(FxRender.renderers)
713724
}
714725

715726
override def runModal(content: UiWidget, hideTitle: Boolean = false, close: Option[Subject[_ >: Unit]] = None): Unit = {
@@ -797,15 +808,4 @@ object FxRender {
797808
var primaryStage: Stage = _
798809
var postAction: UiRenderer => Unit = _
799810

800-
class App extends Application {
801-
override def start(primaryStage: Stage): Unit = {
802-
FxRender.primaryStage = primaryStage
803-
val rootContent = FxRender.renderers.renderer(FxRender.rootContent)(FxRender.renderers).render()
804-
applyContentToState(rootContent, primaryStage, fullScreen = true)
805-
primaryStage.show()
806-
if (postAction != null) postAction(FxRender.renderers)
807-
}
808-
}
809-
810-
811811
}

0 commit comments

Comments
 (0)