When starting a multi-release application with Java 9 WebStart the classes located in META-INF/versions/9 will be ignored when the WebStart application cache is disabled. As soon as the WebStart cache is enabled it works fine.
A simple test can be found below, you can also give it a try by executing http://www.jyloo.com/downloads/public/test/multiReleaseTest.jnlp
Test case:
----------------------------------
package mrtest;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import mrtest.impl.Implementation;
public class Main extends JFrame{
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run(){
new Main();
}
});
}
public Main(){
add(new JLabel(new Implementation().toString()));
setTitle("MultiRelease Test");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(800, 600);
setLocationRelativeTo(null);
setVisible(true);
}
}
----------------------------------
//Default implementation class
package mrtest.impl;
public class Implementation{
@Override
public String toString() {
return "Default Implementation";
}
}
----------------------------------
//Java 9 implementation class in META-INF/versions/9
package mrtest.impl;
public class Implementation{
@Override
public String toString(){
return "***** Java 9 implementation *****";
}
}
A simple test can be found below, you can also give it a try by executing http://www.jyloo.com/downloads/public/test/multiReleaseTest.jnlp
Test case:
----------------------------------
package mrtest;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import mrtest.impl.Implementation;
public class Main extends JFrame{
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run(){
new Main();
}
});
}
public Main(){
add(new JLabel(new Implementation().toString()));
setTitle("MultiRelease Test");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(800, 600);
setLocationRelativeTo(null);
setVisible(true);
}
}
----------------------------------
//Default implementation class
package mrtest.impl;
public class Implementation{
@Override
public String toString() {
return "Default Implementation";
}
}
----------------------------------
//Java 9 implementation class in META-INF/versions/9
package mrtest.impl;
public class Implementation{
@Override
public String toString(){
return "***** Java 9 implementation *****";
}
}
- duplicates
-
JDK-8191541 Wrong class invoked in Multi-release JAR file on Java 9 when running using file protocol
-
- Closed
-
- relates to
-
JDK-8132734 JDK 9 runtime changes to java.util.jar to support multi-release jar files
-
- Closed
-
-
JDK-8191541 Wrong class invoked in Multi-release JAR file on Java 9 when running using file protocol
-
- Closed
-