fflewddur / tivolibre

Java app and library for decoding TiVo files to standard MPEG files.
GNU General Public License v3.0
34 stars 4 forks source link

Compilation failures #12

Closed opoplawski closed 8 years ago

opoplawski commented 8 years ago

I'm getting the following trying to build tivolibre:

./net/straylightlabs/tivolibre/PyTivoMetadata.java:300: error: illegal start of expression
            list.stream().forEach(e -> writer.format("%s : %s%n", field, e));
                                     ^
./net/straylightlabs/tivolibre/TransportStreamDecoder.java:274: error: ')' expected
        streams.forEach((id, stream) -> stream.pauseDecrypting());
                           ^
./net/straylightlabs/tivolibre/TransportStreamDecoder.java:274: error: illegal start of expression
        streams.forEach((id, stream) -> stream.pauseDecrypting());
                                      ^
./net/straylightlabs/tivolibre/TransportStreamDecoder.java:274: error: ';' expected
        streams.forEach((id, stream) -> stream.pauseDecrypting());
                                                                ^
./net/straylightlabs/tivolibre/TransportStreamDecoder.java:282: error: ')' expected
        streams.forEach((id, stream) -> stream.resumeDecrypting());
                           ^
./net/straylightlabs/tivolibre/TransportStreamDecoder.java:282: error: illegal start of expression
        streams.forEach((id, stream) -> stream.resumeDecrypting());
                                      ^
./net/straylightlabs/tivolibre/TransportStreamDecoder.java:282: error: ';' expected
        streams.forEach((id, stream) -> stream.resumeDecrypting());
                                                                 ^
7 errors
fflewddur commented 8 years ago

It looks like it's failing on the new stream API from Java 8. Can you confirm the version of Java you're using is 1.8.0 or higher?

opoplawski commented 8 years ago

Yeah, this is 1.8.0.

opoplawski commented 8 years ago

Also get it with 1.7.0 though.

fflewddur commented 8 years ago

You'll definitely get it with 1.7, because lambdas were only added in Java 8 :)

Could you verify that your JDK is setup to use 1.8 as the Java compiler, and not just the runtime? The output of javac -version should be something like 1.8.0_66.

The current codebase compiles for me on Oracle's latest Java VM on Mac OS X 10.11.1, Windows 7 SP1, and Windows 10. Each platform build works both from within IntelliJ and using an external Ant build file, so I'm pretty certain there isn't a syntax error in the code.

opoplawski commented 8 years ago

Ah, I found the issue. I was assuming that openjdk 1.8.0 overrode 1.7.0 in EL7, but it doesn't. Sorry for the noise.

fflewddur commented 8 years ago

Cool, glad to hear you got it working!