I downloaded my eclipse ide from here:
https://www.eclipse.org/downloads/packages/
and the jdk from here:
https://www.oracle.com/java/technologies/downloads/#jdk22-windows
but I cant write code that requires swing. So far I don’t really have any code just:
`
import javax.swing.JFrame;
public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame();
}
}
`
In “Window” > “Preferences” I added “Standard VM” and choose the directory with the jdk yet the line:
import javax.swing.JFrame;
still returns an error. I tried making a new project where in the JRE section i choose in “use a project specific JRE” the newly added jdk but that didn’t help. The default JRE is JavaSE-17. What should I do? I feel like this really shouldn’t be a problem but I’m lost.
KetchupGoblin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.