I am trying to communicate my Server with another Cloud service which speaks through a specific protocol that was developed based on Google Protocol Buffer.
I wrote a Java program in Netbeans which is able to read messages from this Cloud service, but these messages appear in my console in an unreadable format. I was said that I must have installed the appropriate protocol to interpret these messages.
So, I installed google protocol buffer for Java and Win:
https://github.com/google/protobuf/releases/tag/v3.5.0
Now, I am trying to use protoc commands in cmd to compile my Java program (which reads the input messages from cloud service) to be able to read the incoming data in understandable format.
Can anyone help me answer these two questions:
Real working example of using Protoc to compile a Java program?
Google says use this:
protoc -I=$SRC_DIR --java_out=$DST_DIR $SRC_DIR/addressbook.proto
https://developers.google.com/protocol-buffers/docs/javatutorial
But I am not able to get this syntax work
What output would this command generate and how/where can I use it to interpret the messages I am receiving in the Netbeans console (with my Java program created in Netbeans)?
Thank you!
Related
I'm trying to create a function on Azure Function Apps that is given back a PDF and uses the python tika library to parse it.
This setup works fine locally, and I have the python function set up in Azure as well, however I cannot figure out how to include Java in the environment?
At the moment, when I try to run the code on the server I get the error message
Unable to run java; is it installed?
Failed to receive startup confirmation from startServer.
So this isnt possible at this time. To solve it, I abstracted out the tika code into a Java Function app and used that instead.
I am trying to write java code to execute remote commands on an SSH, similar to the one in this library: Chilkat Android SSH Execute Remote Commands.
However, I do not know where to begin. I do not need to implement the entire library, I only need to be able to send messages from my computer to a device through a SSH using Java code. Specifically I want to implement the Connect, AuthenticatePw and quickCommand methods in the library.
My question is what do I need to learn in order to be able to write a java file that does this? I would appreciate any links to relevant tutorials.
I'm trying to write a program that would send a function to several nodes, those nodes will receive the function and execute it, replying a result (through serialization). I've searched around a bit, but found nothing of help. An alternative might be to send a .class file over the socket and load it on the node, but i'm interested if anyone has found a simpler way
Edit: I'm trying to make a cluster with this client/server. And I want the client to always run on the nodes and accept any kind of work without having to recompile the client node code
Solution: seems there's no way around not sending a .class file. Have to send it, then load it at runtime
Java is not like some (mostly interpreted) languages where code is data. In order to do what you want with java source code, you would have to send the source code over the wire, compile it to a class file at the other end, and then load the class file. Apart from loading a class file, there is no other way to get new code into a running JVM.
P.S.: Opening up a port on your machine where you accept arbitrary code, and then execute whatever the client sends to you is like owning a Jewelry store, and leaving it un-locked and un-staffed every day when you go out for lunch.
P.P.S.: You could embed an interpreter in your application. E.g., you could embed JRuby, and then the client could send you Ruby code.
Try Hadoop Map/Reduce Framework:
http://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html
Please can you assist me on how to connect JAVA to IBM PCOMM and interact with its screen. Right now, I am just running IBM PCOMM using AutoHotKey (Run and SendInput), no API at all, just an automated keyboard input care of AHK script.
I am also thinking of writing AHK script to connect to IBM PCOMM and run it in my JAVA program as exe, but unfortunately, I don't know either how to write that script.
I am using Eclipse JUNO.
I'm also doing the same things like your. I'm using jacob - a com-java bridge component for java. I've just started my project for one week and the result I've got is quite fessible. Until know, I can wrap all the PCOMM com object by java and work with it properly. You can study jacob at this link: http://sourceforge.net/projects/jacob-project/ and danadler.com/jacob/ .
I'm currently using Haxe with Flash target for a project.
What I want to do is to send a serial signal to my Arduino board, I couldn't find a way using only Haxe so I'm using Processing 2(http://processing.org/) which gets the job done.
The problem now is to make Haxe and Processing communicate, I've tried looking into memory mapped files, but Haxe and Java seem to work differently with those (Haxe needs an Int for address and Java uses a file).
And even creating a file to be read by processing and written by Haxe isn't working (Java gives a FileNotFound execption).
The main goal is to make Haxe send a signal to Arduino, I'm just using Processing 2 as a bridge, but any solution is welcome.
Do any one know a good way to solve this problem?
Thank you for the attention.
You can use sockets to communicate between software. Typically they are used over the internet, but it works great locally as well. For Processing, you would use the Network library, and it appears Haxe has a library as well.