Compiling Java class targeting 1.7 with classes built with JDK 8 on class path -


i have following scenario:

class foo references method in class bar. i'd compile class foo javac targeting java 1.7 providing bar.class binary on class path uses java 8 syntax , compiled jdk 8. in production, jre 1.7 used run application different copy of bar.class on classpath - version of class bar uses java 1.7 syntax , built jdk 7.

  1. assuming method signatures bar remain same, there issues compiling , running foo?
  2. can compile foo using jdk 7 or must use jdk 8?

for straight javac, can use -source/-target let java8 jdk build java7 class files (which means putting different version number in class file).

my builds use maven, , while jenkins server building java8, source/target specified 1.7 , run existing java7 jdk. when first dependent project migrated java8, maven pom changed build 1.8 target , forced upgrade.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -