Skip to content

Make it work also on JDK9 with new versioning scheme #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;

import javax.annotation.WillClose;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -119,8 +118,7 @@ public abstract class AbstractZipArchiver
* Java versions from 8 and up round timestamp up.
* s
*/
private static final boolean isJava7OrLower =
Integer.parseInt( System.getProperty( "java.version" ).split( "\\." )[1] ) <= 7;
private static final boolean isJava7OrLower = getJavaVersion()<= 7;

// Renamed version of original file, if it exists
private File renamedFile = null;
Expand All @@ -133,6 +131,16 @@ public abstract class AbstractZipArchiver

protected ZipArchiveOutputStream zipArchiveOutputStream;

private static int getJavaVersion(){
String javaSpecVersion = System.getProperty( "java.specification.version" );
if (javaSpecVersion.contains(".")) {//before jdk 9
return Integer.parseInt(javaSpecVersion.split("\\.")[1]);
}else {
return Integer.parseInt(javaSpecVersion);
}
}


public String getComment()
{
return comment;
Expand Down