Try this, it may be helpful:
String s = new String();
System.out.println(s.getClass().getPackage().getSpecificationVersion());
System.out.println(s.getClass().getPackage().getImplementationVersion());
Output:
1.7
1.7.0_25
More Related Contents:
- How to load Classes at runtime from a folder or JAR?
- How do I invoke a Java method when given the method name as a string?
- How to import a jar in Eclipse?
- What causes java.lang.IncompatibleClassChangeError?
- Java, Classpath, Classloading => Multiple Versions of the same jar/project
- Add JAR files to a Spark job – spark-submit
- How to include jar files with java file and compile in command prompt
- Eclipse: How to build an executable jar with external jar?
- Access restriction: The type ‘Application’ is not API (restriction on required library rt.jar)
- Can a Java class add a method to itself at runtime?
- Eclipse “Error: Could not find or load main class”
- Retrieving the inherited attribute names/values using Java Reflection
- How to build sources JAR with Gradle?
- How to read a file from a jar file?
- How to bundle images in jar file
- Execute jar file with multiple classpath libraries from command prompt
- Is there something like instanceOf(Class c) in Java?
- include external jar when running java -jar
- How to get annotations of a member variable?
- Updating .class file in jar
- Java reflection: how to get field value from an object, not knowing its class
- I can run .jar files through cmd, but I cannot double click them [closed]
- How to create a .jar file using the terminal
- Java dynamic function calling
- What is the difference between getFields and getDeclaredFields in Java reflection
- Dynamically find the class that represents a primitive Java type
- Instantiate a class object with constructor that accepts a string parameter?
- How to get annotation class name, attribute values using reflection
- How can I improve performance of Field.set (perhap using MethodHandles)?
- Simple way to get wrapper class type in Java