How To Make Electron App With Java Backend

Hello everybody,

I’m new to electron.
I have my own Javafx desktop application working perfectly.
Now I want to make better gui design for my app which unfortunately javafx is not capable of.

So anybody can help me out with any idea how do i develop electron app which contain java as a controller backend ??

In my Java app, I have used “PRINTWRITER” class. So is there any possibility to access the same or similar class in electron ?

Thank you.

Electron is designed to build native-looking applications using web technologies like HTML, CSS and JavaScript. There isn’t any way to make Electron use some other language like Java without Herculean effort.

He can keep his backend in Java and create an API to communicate with his Electron application.

I don’t think he’s asking how to write an Electron app in Java.

1 Like

You can use that same class if it’s available to use via node-java.

That project is here:

I’m skeptical that whatever it is you’re trying to do isn’t possible in JavaFX-or that a rewrite is the best mitigation path.

Your best bet if you do decide to throw away your entire front end is to write the Java side as an API.

I think that’s can be done. Using node-java to communicate from electron to java, and using a local server to talk from java backend to electron. Or just use local server to implement both direction communication

Anyone learned anything new about using Electron with a Java back-end?

I’m new to Electron, but not new to javascript and java communications. I think it should be possible to connect to a hosted (locally or remotely) java server and connect to it with any Electron app. SpringBoot has all of this built in. You might be able to package the .jar in with your electron app and launch it from electron when it starts. I’m not sure about security, etc.

Just tested this project that runs a Java/JVM application using Electron. Works for my case at least:

1 Like

I’m the author of this repo and actually we use the same approach in our real-life applications. It was a PoC for our development tool that was a browser based application. We have just released electron based version of the tool and we are happy with the result. PM me if you are interested in links to the real life application based on this java+electron approach.

1 Like

Hi. First of all thanks for the repo. Can you kindly provide more details as I am interested in being able to use this? Thank you

Next week, I’m going to publish complete tutorial on the approach here: So, if you need more detailed explanations, follow the link on next Monday.

The result of our research is the product of my company:


Thank you very much. At the moment I was using JavaFX webengine to load the html frontend, however looking into using electron, due to issues

Draft of the tutorial has been published!

Will have a look. Thanks for your help. Much appreciated

See this

OMG, this is a 2016 post.
I’m trying to do the samething, not sure my reply still relevant, but I think I’ll focus on how to bridge between Java-Javascript (which there’s plenty of library to archieve, Google alone have a few of it).
It’s 2019 and you can convert Java into native executables. Graalvm perfectly fine wo call from java to native, javascript to java, native to javascript vice-versa.