Java protoc compiling issues - java

I am compiling proto file using command line mention below.
protoc -I ./ --python_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_python_plugin` ./test.proto
Above command i am issuing is to generate python based code and it works fine.
Now same command i tried to issue for Java based code but getting errors.
protoc -I ./ --java_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_java_plugin` ./test.proto
I looked at my plugin directory and found that following plug-ins are installed but not the Java one.
grpc_csharp_plugin
grpc_cpp_plugin
grpc_objective_c_plugin
grpc_node_plugin
grpc_python_plugin
grpc_ruby_plugin
How can i found the Java Plugin?

The plugin is hosted on Maven Central: http://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/
While there isn't a protobuf plugin for Java (it is built into protoc), there is a plugin for the gRPC generated Stubs. Normally this is provided for you by default as a Gradle plugin, but you can manually download and use the plugin. Currently, there are Linux, OSX and Windows builds.

Related

How to consume a Java soap web service using Java app based on JDK 11

I created a web service with java, I've used jaxb and jax-ws annotations with the help of maven dependencies, I'd like to consume that web service with java application after some research I found that I should run a wsimport command to generate JAX-WS portable artifacts, however this command is no longer available in jdk 11 and above so where can i find the executable file and add it to my jdk bin folder?
You can download JAXWS-RI zip distribution file from the Maven repo. I'm using version 2.3.3-b01 and works fine.
After download, you can symlink the wsimport.sh script to your PATH:
$ cd ~/bin # or other location in your path
$ ln -s /path/to/jaxws-ri-zip-contents/bin/wsimport.sh wsimport
Now you can call wsimport as a command.

Running application with java + maven + tomcat (embedded) the port is not found

I've got no previous experience with java. Trying to run project from github - https://github.com/ESPD/ESPD-Service. The Service uses Maven for building multi-module Maven project. I'm using mvn clean package in order to generate the project.war file. Then type java -Dspring.profiles.active=prod -Xms768m -Xmx768m -jar project.war and the app is running in a Tomcat container with port 8080 and it shows on the cmd console that the app is running perfectly but the problem comes when i try to access the localhost:8080. It says Not Found and I've been looking all over the internet to find a solution but without success. Will appreciate a lot if someone gives me a hand on that one.
Java version should be JDK 1.8,
Maven version must be no greater than 3.5.0
Then add 2 libraries to ESPD-Service\espd-web\target\espd-web\WEB-INF\lib folder: mail-1.4.7.jar and activation-1.1.1.jar cuz they are currently missing.
After that run mvn install in order to install all the jars files and then run the java -Dspring.profiles.active=prod -Xms768m -Xmx768m -jar espd-web.war as it's written on the docs. And also when the app is running on localhost:8080 make sure you add localhost:8080/espd

Building an Android project from the command line with Docker

I inherited Android Java-code in my company, without Gradle-files etc, and I want to be able to compile this on my dev-server (I program from a ChromeOS machine, hence a CLI SSH connection to a server where I do dev stuff). Now I found some Docker images like this one (which doesn't even have a working command line example) but I haven't managed to create an APK yet. What am I missing and how would you do this?
You have three steps to do:
Migrate your project to gradle.
It isn't too difficult since there are plenty of gradle project out there and you can try to follow them or just read "Migrating to Gradle" article.
Build project with gradle on local machine.
If you migrated properly you can build your project in terminal like:
./gradlew assembleDebug
but it might be also assembleDevDebug or assembleProdRelease which depends on your buildType and flavor in gradle. Check which assembles are available by running:
./gradlew tasks
Build project using Docker.
Based on image you linked:
docker run -t -i ksoichiro/android -v /path/to/project:/workspace -w workspace /bin/sh -c "./gradlew assembleDebug"

How to build jar Library for openconnect client? (no configure file)

I want to build a jar-library for the openconnect client. But I couldn't find the configure-file there is only a configure.ac file that seems to include the code for the configure file. The content of the readme-file couldn't help me:
Description:
This directory contains a JNI interface layer for libopenconnect, and a
demo program to show how it can be used.
Build instructions:
From the top level, run:
./configure --with-java
make
cd java
ant
sudo java -Djava.library.path=../.libs -jar dist/example.jar <server_ip>
If ocproxy[1] is installed somewhere in your $PATH, this can be run as a
non-root user and it should be pingable from across the VPN.
Test/demo code is in src/com/example/
OpenConnect wrapper library is in src/org/infradead/libopenconnect/
[1] http://repo.or.cz/w/ocproxy.git
ant worked but ./configure didn't work.
Any suggestions?

Installing opencv on openshift for java development

I am trying to install opencv on openshift. following the post mentioned here
http://codingexodus.blogspot.in/2013/04/how-to-install-opencv-on-openshift.html
I am developing in java so i have installed jdk1.8 and apache ant into the $OPENSHIFT_DATA_DIR
I had to install apache ant also so i did the same again in the $OPENSHIFT_DATA_DIR
my JAVA_HOME is set to the jdk and even ANT_HOME is also pointing to the right place
JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk1.8.0_05"
I am doing a cmake in the end to generate the makefile with the command
cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_SHARED_LIBS=OFF ..
going through the cmake output i do see that for java it has found the ant, jni etc. finally when i execute a
make
make install
i get the error
make: *** No targets specified and no makefile found. Stop.
there is no make file generated. what am missing.

Categories

Resources