1

I'm implementing an application in Meteor that requires a lot of processing. Because of this, we are attempting to use code written in java. I currently have an embedded web socket server that runs from a jar file, via command line. The idea being that when a user connects to Meteor from a cordova device, the embedded java jar file will be run creating a processing instance for that user.

I can't find any definitive information as to how to run a shell command or if it would be allowed on an android or ios device. I have tried using meteorhacks:npm and the child_process packages, but am having little luck with them.

Filesystem:

.
app/
   /server
   /public
   /client
   /lib
assets/
server.jar

Websocket:

The embedded server runs on http://localhost:8080. So a client connecting would be able to connect to their own instance.

Any ideas as to how to run these shell commands?

EDIT:

Yes I do want to run the embedded websocket server ON THE CLIENT.

Upon running the .jar file, a server session would be launched at http://localhost:8080 from the device calling it. In this case, the client's mobile device.

acupofjose
  • 2,159
  • 1
  • 22
  • 40
  • I get the sense that you are misunderstanding something about how meteor works on cordova. The server code does *not* run on the mobile device. So npm does not apply, and `localhost:8080` is not a destination that your mobile will be able to use for anything (because nothing is running at that destination). Your server code still needs to run on a web server. Given this, could you clarify whether you want to run the java code on the server or indeed on the client? – Christian Fritz Nov 03 '15 at 17:44
  • @ChristianFritz I do want to run the code on the client – acupofjose Nov 03 '15 at 18:11
  • @ChristianFritz Edited for clarity – acupofjose Nov 03 '15 at 18:21
  • ah, ok. Yes that makes sense. Thanks for clarifying. – Christian Fritz Nov 03 '15 at 19:20
  • 1
    Looks like others were looking for that, too, but didn't get an answer either. http://stackoverflow.com/questions/26875701/executing-shell-command-on-android -- I think it's quite possible that you will need to write a plugin. iOS definitely is generally too restrictive to allow arbitrary code to run. Also, I'm not even sure iOS has a JVM installed. – Christian Fritz Nov 03 '15 at 19:22
  • @ChristianFritz thaks for replying. I can't seem to find information on it anywhere either, at least, nothing conclusive. – acupofjose Nov 03 '15 at 22:07

0 Answers0