I have a rather old project that uses Ant, that I’m trying to migrate to Gradle. However, I seem to have hit an issue where the code is trying to import import sun.swing.table.*;
, yet Gradle can’t seem to find the symbols which are in $JAVA_HOME/lib/rt.jar
.
The .java file that I’m trying to compile is this:
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package sample.build;
import sun.swing.table.*;
public class Library {
public boolean someLibraryMethod() {
return true;
}
}
The output of ./gradlew build
is:
./gradlew build
> Task :compileJava FAILED
/private/tmp/sample-build/src/main/java/sample/build/Library.java:6: error: package sun.swing.table does not exist
import sun.swing.table.*;
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
1 actionable task: 1 executed
Exit 1
Any help would be great.
System details
- Java: 1.8.0_171
- Gradle Version: 5.2
- OS: Mac OS X