From a blog post:
To use javac from JDK N to cross-compiler to an older platform version, the correct practice is to:
- Use the older -source setting.
- Set the bootclasspath to compile against the rt.jar (or equivalent) for the older platform.
If the second step is not taken, javac will dutifully use the old language rules combined with new libraries, which can result in class files that do not work on the older platform since references to non-existent methods can get included.
Related Posts:
- What does “Could not find or load main class” mean?
- Implementing UML diagram to Java [closed]
- Reading a plain text file in Java
- Converting double to string
- What is the “continue” keyword and how does it work in Java?
- Java String new line
- What does the protected modifier mean?
- Java default constructor
- What is the meaning of “this” in Java?
- ‘Java’ is not recognized as an internal or external command
- Java: Identifier expected
- How does Java’s PriorityQueue differ from a min-heap?
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse
- Converting double to integer in Java
- Difference between HashSet and HashMap?
- How to split a String by space
- Java compile error: “reached end of file while parsing }”
- Exception in thread “main” java.util.NoSuchElementException: No line found
- Java Method Call Expected
- Double % formatting question for printf in Java
- in java what does the @ symbol mean?
- How to call a method in another class in Java?
- unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
- Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed
- Java, “Variable name” cannot be resolved to a variable
- How to convert a Binary String to a base 10 integer in Java
- Using @RequestLine with Feign
- What is the best/simplest way to read in an XML file in Java application?
- Received fatal alert: handshake_failure through SSLHandshakeException
- DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704
- Why would a “java.net.ConnectException: Connection timed out” exception occur when URL is up?
- HashSet vs. ArrayList
- FIFO based Queue implementations?
- How to import a .cer certificate into a java keystore?
- Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0 error in Java
- How can I represent a range in Java?
- How to solve error: ‘;’ expected in Java?
- Making a Java Makefile
- Censored Words Condition
- method in class cannot be applied to given types
- Error Message: Can’t determine a valid Java Home
- How can I fix ‘android.os.NetworkOnMainThreadException’?
- Eclipse does not start when I run the exe?
- How to print to the console in Android Studio?
- java.lang.NumberFormatException: null i
- How do you #include files in java?
- How to use Java in Visual Studio 2017
- List of Arrays in Java
- Extending from two classes
- Caused by: java.security.UnrecoverableKeyException: Cannot recover key
- How can I truncate a double to only two decimal places in Java?
- How do I add a simple jQuery script to WordPress?
- I get the error int cannot be converted to boolean?c
- Can’t install JDK 9 because “Another Java installation is in progress”
- java.sql.SQLException: No database selected – why?
- Java: How to access methods from another class
- Cannot make a static reference to the non-static method fxn(int) from the type Two
- What is causing this Java “Cannot find symbol” error?
- What does equals(Object obj) do?
- How do I make the method return type generic?
- keytool error bash: keytool: command not found
- Java Error: The constructor is undefined
- Java Embedding Into HTML
- Why it is mandatory to use “throws IOException”
- Terminating a Java Program
- How to add an image to a JPanel?
- How to create JSON Object using String?
- Why do some classes require main methods and others do not?
- java.util.IllegalFormatConversionException
- What do F and D mean at the end of numeric literals?
- Coding Conventions – Naming Enums
- Sort ArrayList of custom Objects by property
- Java better way to delete file if exists
- How to send HTTP request in java? [duplicate]
- Best way to represent a fraction in Java?
- java IO Exception: Stream Closed
- Can a normal Class implement multiple interfaces?
- What kind of Java type is “[B”?
- Hibernate – Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
- Node cannot be resolved to a type
- E/AndroidRuntime﹕ FATAL EXCEPTION: main
- Java: is there an easy way to select a subset of an array?
- void is an invalid type for this variable
- syntax error: insert } to complete ClassBody
- How to print the value of variable in java [duplicate]
- File to byte[] in Java
- Eclipse: JVM terminated. Exit code=2
- How to programmatically close a JFrame
- Playing .mp3 and .wav in Java?
- Difference between jar and war in Java
- Adding image to JFrame
- Java Fraction Calculator
- How to convert a date to milliseconds
- Eclipse IDE – Error: Build path specifies execution environment Java SE 1.7
- Mockito : doAnswer Vs thenReturn
- How Do I Implement an Insertion Sort Method for A Generic ArrayList?
- Troubleshooting “The type parameter T is hiding the type T” warning
- model.addAttribute() parameters
- StringFormat for Java Boolean Operator
- JOptionPane Yes or No window