Check the FAQ : https://www.oracle.com/technetwork/java/javase/overview/faqs-jsp-136696.html
Is Java still free?
The current version of Java - Java SE 9 as well as Java SE 8 - is free and available for redistribution for general purpose computing. Java SE continues to be available under the Oracle Binary Code License (BCL) free of charge. JRE use for embedded devices or use of commercial features may require a license fee from Oracle. Read more about embedded use of Java SE or contact your local Oracle sales representative to obtain a license.