Nodejs: Spawn jar (non executable)

248
April 26, 2018, at 08:46 AM

I have a Java jar file, which is not executable(does not have a main method). However I would like to invoke a particular class and its methods from my node.js application. I am currently using the below:

var child = require('child_process').spawn(
'java', ['-cp', "abc.jar", com.abc.ABCClass]
);

How now can I invoke the method in the ABCClass with appropriate arguments? I currently get an exception such as below:

A JNI error has occurred, please check your installation and try again
Exception in thread "main" 
Error: java.lang.NoClassDefFoundError: 
org/apache/kafka/clients/consumer/KafkaConsumer

Thanks in advance. I am looking for a solution to call the method in that class.

Rent Charter Buses Company
READ ALSO
ElectronJS code protection 2018

ElectronJS code protection 2018

I am about to begin the process of creating a Windows-based utility app to manage localized expressjs server that will utilize a graphical Windows based application to manage some of the features of this service

367
React styles and clicks not binding to express rendered markup

React styles and clicks not binding to express rendered markup

I have been working on server side rendering some react components, and in terms of rendering markup it is going pretty well

263
React+Express: Getting error ECONNREFUSED when trying to grab data with fetch

React+Express: Getting error ECONNREFUSED when trying to grab data with fetch

Getting back into node but I'm having trouble connecting my front (React) and back (Node/Express)I went through David Ceddia's article on his site and it works, 100% works with his example

628
Headless Chrome script to use the same session and skip two-factor authentication

Headless Chrome script to use the same session and skip two-factor authentication

There is a website that uses two-factor authenticationOn the login form there is a checkbox that, when checked, allows me to bypass the two-factor authentication step (for the current device) in the future after successfully logging in the first time

200