What does "I can no longer get this to work' mean?
For some reason, the compiler/translator thinks that JSONObject is a package, not a class.
Why is this code not in a servlet where it would be easier to debug? Putting Java code into a JSP is a bad practice that's been obsolete for over 16 years.
HTTP Status 500 - Unable to compile class for JSP:
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line:  in the generated java file: [/usr/share/apache-tomcat-8.0.50/work/Catalina/localhost/jjaora/org/apache/jsp/jja_005fexamples/result4_jsp.java]
Only a type can be imported. org.json.simple.JSONObject resolves to a package
An error occurred at line: 8 in the jsp file: /jja_examples/result4.jsp
JSONObject cannot be resolved to a type
6: String name = request.getParameter("name");
7: String age = request.getParameter("age");
8: JSONObject json = new JSONObject();