Installation/usage - Java version

26 views
Skip to first unread message

dp

unread,
Nov 20, 2009, 8:03:28 PM11/20/09
to Protocol Buffers
Hi,

I needed some help with the Java version. Followed the steps in the
README(s) [C++/Java], but got some errors with the test step. Have
added the details below. (Also, saw similar errors with mvn package as
well)

It would be great if someone could point me in the right direction.
Thanks.

Regards,
dp

Disclaimer: Java + protocol buffers neophyte. :)

Details:

[dp@lothlorien java]$ mvn test
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building Protocol Buffer Java API
[INFO] task-segment: [test]
[INFO]
------------------------------------------------------------------------
[INFO] [antrun:run {execution: generate-sources}]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] Registering compile source root /home/dp/protocol_buffers/
protobuf-2.1.0/java/target/generated-sources
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dp/protocol_buffers/
protobuf-2.1.0/java/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 2 source files to /home/dp/protocol_buffers/
protobuf-2.1.0/java/target/classes
----------
1. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 440)
while (pos < matcher.regionStart()) {
^^^^^^^^^^^
The method regionStart() is undefined for the type Matcher
----------
2. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 451)
if (matcher.regionStart() == matcher.regionEnd()) {
^^^^^^^^^^^
The method regionStart() is undefined for the type Matcher
----------
3. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 451)
if (matcher.regionStart() == matcher.regionEnd()) {
^^^^^^^^^
The method regionEnd() is undefined for the type Matcher
----------
4. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 455)
matcher.usePattern(TOKEN);
^^^^^^^^^^
The method usePattern(Pattern) is undefined for the type Matcher
----------
5. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 458)
matcher.region(matcher.end(), matcher.regionEnd());
^^^^^^^^^
The method regionEnd() is undefined for the type Matcher
----------
6. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 462)
matcher.region(pos + 1, matcher.regionEnd());
^^^^^^^^^
The method regionEnd() is undefined for the type Matcher
----------
7. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 474)
matcher.usePattern(WHITESPACE);
^^^^^^^^^^
The method usePattern(Pattern) is undefined for the type Matcher
----------
8. ERROR in /home/dp/protocol_buffers/protobuf-2.1.0/java/src/main/
java/com/google/protobuf/TextFormat.java (at line 476)
matcher.region(matcher.end(), matcher.regionEnd());
^^^^^^^^^
The method regionEnd() is undefined for the type Matcher
----------
8 problems (8 errors)[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac, but could not parse the error:


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 18 seconds
[INFO] Finished at: Fri Nov 20 16:46:29 GMT-08:00 2009
[INFO] Final Memory: 35M/42M
[INFO]
------------------------------------------------------------------------
[dp@lothlorien java]$ protoc --version
libprotoc 2.1.0
[dp@lothlorien java]$

Kenton Varda

unread,
Nov 20, 2009, 9:01:15 PM11/20/09
to dp, Protocol Buffers
What version of Java are you using?  It looks like the regular expression API is missing some methods.


--

You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=.



dp

unread,
Nov 24, 2009, 2:11:18 PM11/24/09
to Protocol Buffers
[dp@lothlorien ~]$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6) (fedora-21.b16.fc10-i386)
OpenJDK Server VM (build 14.0-b16, mixed mode)
[dp@lothlorien ~]$
> > protobuf+u...@googlegroups.com<protobuf%2Bunsubscribe@googlegroups.c­om>
> > .

Kenton Varda

unread,
Nov 24, 2009, 3:28:33 PM11/24/09
to dp, Protocol Buffers
http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html#regionStart()

Is it possible that Maven is using some other (older) Java installation?

To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.



dp

unread,
Nov 24, 2009, 7:08:52 PM11/24/09
to Protocol Buffers
You were right. Works fine now.

Thanks for the help!!

[dp@lothlorien ~]$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.6.0_0
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.27.37-170.2.104.fc10.i686" arch: "i386"
Family: "unix"
[dp@lothlorien ~]$

On Nov 24, 12:28 pm, Kenton Varda <ken...@google.com> wrote:
> http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html#re...()
>
> <http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html#re...()>Is
> > <protobuf%2Bunsubscr...@googlegroups.c­om>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/protobuf?hl=.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Protocol Buffers" group.
> > To post to this group, send email to prot...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > protobuf+u...@googlegroups.com<protobuf%2Bunsubscribe@googlegroups.c­om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/protobuf?hl=en.
Reply all
Reply to author
Forward
0 new messages