File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/main/java/org/codehaus/plexus/archiver/zip Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 3434import org .codehaus .plexus .util .FileUtils ;
3535import org .codehaus .plexus .util .IOUtil ;
3636
37- import javax .annotation .WillClose ;
3837import java .io .ByteArrayInputStream ;
3938import java .io .File ;
4039import java .io .FileOutputStream ;
@@ -119,8 +118,7 @@ public abstract class AbstractZipArchiver
119118 * Java versions from 8 and up round timestamp up.
120119 * s
121120 */
122- private static final boolean isJava7OrLower =
123- Integer .parseInt ( System .getProperty ( "java.version" ).split ( "\\ ." )[1 ] ) <= 7 ;
121+ private static final boolean isJava7OrLower = getJavaVersion ()<= 7 ;
124122
125123 // Renamed version of original file, if it exists
126124 private File renamedFile = null ;
@@ -133,6 +131,16 @@ public abstract class AbstractZipArchiver
133131
134132 protected ZipArchiveOutputStream zipArchiveOutputStream ;
135133
134+ private static int getJavaVersion (){
135+ String javaSpecVersion = System .getProperty ( "java.specification.version" );
136+ if (javaSpecVersion .contains ("." )) {//before jdk 9
137+ return Integer .parseInt (javaSpecVersion .split ("\\ ." )[1 ]);
138+ }else {
139+ return Integer .parseInt (javaSpecVersion );
140+ }
141+ }
142+
143+
136144 public String getComment ()
137145 {
138146 return comment ;
You can’t perform that action at this time.
0 commit comments