Problem & Background-info
I'm trying to develop an application for a client of mine on Fiverr and he requested I use the applet library I have never used before. I did a little tutorial and I keep getting an apple not initialized error and I have no idea how to fix it.
##Goal
I just want java to display the thing I drew on the applet viewer without throwing an error.
Code
import java.awt. *;
import java.applet. *;
//<applet code = app height=400 width = 400></applet>
public class app extends Applet {
public void paint(Graphics g){
g.drawOval(40,40,120,150);
g.drawOval(57, 75, 30, 20);
g.drawOval(110, 75, 30, 20);
g.fillOval(68, 81, 10, 10);
g.fillOval(121, 81, 10, 10);
g.drawOval(85, 100, 30, 10);
g.fillArc(60, 125, 80, 40, 180, 180);
g.drawOval(25, 92, 15, 30);
g.drawOval(160, 92, 15, 30);
}
}
Terminal
danielcaminero@Macbook-Air-3 src % javac app.java
Note: app.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
danielcaminero@Macbook-Air-3 src % appletviewer app.java
2022-05-29 09:28:18.859 appletviewer[18039:277277] CoreText note: Client requested name ".HelveticaNeueDeskInterface-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-05-29 09:28:18.859 appletviewer[18039:277277] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2022-05-29 09:28:19.126 appletviewer[18039:277277] CoreText note: Client requested name ".HelveticaNeueDeskInterface-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-05-29 09:28:19.127 appletviewer[18039:277277] CoreText note: Client requested name ".HelveticaNeueDeskInterface-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
java.lang.UnsupportedClassVersionError: app has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:217)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:152)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:627)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:799)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:728)
at sun.applet.AppletPanel.run(AppletPanel.java:378)
at java.lang.Thread.run(Thread.java:748)