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();
jar -tf Pack.jar
should match the path where it is stored in the jar file,
, where "." is the root of the jar file.
/usr/share/java8/jdk1.8.0_20/bin/java -agentlib:jdwp=transport=dt_socket,address=8787,server=n,suspend=n,timeout=10 my.example.StuckLoop
ERROR: transport error 202: recv failed during handshake: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)