I am on OS X Mavericks and starting learning about protobuf, i download the example from https://code.google.com/p/protobuf/downloads/list
I am successfully able to create the .java file from the proto but while compiling the existing java code using
make java, i am getting following error
com/example/tutorial/AddressBookProtos.java:91: package com.google.protobuf does not exist
com.google.protobuf.GeneratedMessage
^
com/example/tutorial/AddressBookProtos.java:12: package com.google.protobuf does not exist
extends com.google.protobuf.MessageOrBuilder {
^
com/example/tutorial/AddressBookProtos.java:9: package com.google.protobuf does not exist
com.google.protobuf.ExtensionRegistry registry) {
^
com/example/tutorial/AddressBookProtos.java:2495: package com.google.protobuf.Descriptors does not exist
private static com.google.protobuf.Descriptors.Descriptor
^
com/example/tutorial/AddressBookProtos.java:2498: package com.google.protobuf.GeneratedMessage does not exist
com.google.protobuf.GeneratedMessage.FieldAccessorTable
....
....
Any resolution to this?
Thanks
Met the same problem and finally got it working. Here's what I did(using version 2.6.0) on OSX 10.9:
Do everything java/README.txt tells you to
if maven package succeed, you'll get a protobuf-java-2.6.0.jar under target folder, for me it's /Users/laike9m/Dev/protobuf-2.6.0/java/target/protobuf-java-2.6.0.jar.
create ~/Library/Java/Extensions folder, note: this is platform specific operation, for OS other than OSX it should be $JAVA_HOME/lib/ext
copy protobuf-java-2.6.0.jar to ~/Library/Java/Extensions
Then you should be able to run make java successfully.
You need to include libprotobuf.jar in your CLASSPATH. Follow the instructions under java/README.txt in the Protobuf source package to build it.
What #laike9m suggested only partially worked for me. I definitely tried to do everything java/README.txt as #laike9m suggested. I had to install maven. I used brew to do that (brew install maven). I then built the protocol buffers java source using mvn package. The first time I tried that, it failed due to some obscure-ish error. I built the C++ code using ./configure && make. Next time I tried to build the java code using mvn package it worked. It put the resulting jar in a folder called target. I think went back to the examples area and was able to build the java example using make but I had to modify the Makefile by adding the -classpath... part below:
javac_middleman: AddPerson.java ListPeople.java protoc_middleman
javac -classpath .:../java/target/protobuf-java-2.6.1.jar:$$CLASSPATH AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java
#touch javac_middleman
Download protobuf.jar from below link and add jar file into libs folder.Its work for me.
https://code.google.com/archive/p/android-market-api/downloads
Related
I am trying to follow this example but I found one problem. I am trying to compile ODL controller but the files structure have changed compared to the previous versions and I don't know in what path I have to be to compile the controller.
I am following
git clone https://git.opendaylight.org/gerrit/p/controller.git
Check that the used Yang tools version is >= 0.5.8-SNAPSHOT.
But I have 0.8.0 (downloaded today in the same link).
And then I have to do this to compile the ODL controller:
cd controller/opendaylight/distribution/opendaylight
mvn clean install
But this path doesn exist on the version I have donwloaded.
¿In what directory I have to be to run the mvn clean install?
The ping example wiki is old and outdated. That was back when everything was in the controller project except for yangtools and before ODL was converted to use karaf. So the controller/opendaylight/distribution/opendaylight directory is long gone. So if you want to create and run the ping example, you would create a karaf feature and run the karaf distro in the controller project. You can follow what is done with the toaster sample and its associated wiki which is pretty up-to-date: https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Toaster_Step-By-Step.
just run 'mvn clean install' in the root dir (so, the "controller" dir).
also, to be safe, I'd delete your "repository" directory in your .m2
dir (usually, in ~/.m2/repository).
Finally, make sure your mvn .settings.xml file is correct. here's a
link for that.
I have tried to build on jenkins slave with osx on it and got this error. When I log into machine, I can run ant -version and it works. Only when I try to build from jenkins this error occurs:
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
I have found that the problems lies within brew version of ant. If i have installed separate version it works. I have found that it may be caused by different dir structure. In Brew version there is a libexec dir whether in "ordinary" there is a lib dir. Maybe creating symlink to libexec with lib name it would work but i haven't checked it.
I created a project in hackage that I want to import into my code.
Rather than manually copy-pasting the code from "print-debugger-0.0.tar.gz" into the src folder of my cabal project, I want to be able to do this...
// project.cabal file
name: project
...
executable project
main-is: Main.hs
hs-source-dirs: src
build-depends: base, split, print-debugger
And do this...
cabal install print-debugger
And import "StackTraceDebug" into my project.
When I try I get messages...
"this package is not installed"
"cabal: There is no package named 'print-debugger'"
How do I get my code out of hackage and into my project without manually copying and pasting?
It appears as though version 0.0 failed to install due to missing files (see: https://hackage.haskell.org/package/print-debugger-0.0/reports/1) but that later versions have fixed this issue and now things should work smoothly.
If you have problems with cabal, you might consider trying stack in the future. It's very helpful for coordinating dependencies between projects.
OK. Here's the problem and it's driving me crazy!!!
I followed the instruction online, installed hadoop and when running the text it said snappy local library can't be loaded.
It's said I have to install snappy first and then install hadoop-snappy.
I download snappy-1.0.4 from google code and do the following:
cd ../snappy-1.0.4
./configure
make
sudo make install
Then it's the problem when:
mvn package -Dsnappy.prefix=/usr/local
The post online said by default the snappy should be installed in the /usr/local.
But I got the following error and no matter what I change the path, still get erro:
The goal you specified required a project to execute but there's no POM in the directory. Please verify you invoked the maven from the correct directory.
It's the wrong directory of mvn? Or improper of snappy? And it said lack of pom that should be a .xml that in no where I can find..
Please help!
Alright, so looking at that page, you are in the wrong directory.
The directory you should be in for that step is "hadoop-snappy" which you can see has a pom.xml, you can verify by looking at the github, https://github.com/electrum/hadoop-snappy.
So after you follow these steps from the guide you showed me.
Download it(hadoop-snappy) from GitHub
Install libtool, make sure ‘libtoolize’ works
Install Maven 3 if necessary
Change your directory to hadoop-snappy and run the command you were trying before.
Let be a library A that I compile with CMake. I also want to distribute it via a package (e.g. RPM).
Where should my package install the files AConfig.cmake and AConfigVersion.cmake ?
In /usr/share/cmake/Modules on Linux ?
You should find what you need here:
http://www.cmake.org/Wiki/CMake/Tutorials/Packaging
With the relevant portion of the text:
Consider a project "Foo" that installs the following files:
<prefix>/include/foo-1.2/foo.h
<prefix>/lib/foo-1.2/libfoo.a
It may also provide a CMake package configuration file
<prefix>/lib/foo-1.2/foo-config.cmake
The config files need the be in your install tree. Only the FindXXX.cmake file should go in the modules directory.