Skip to content

Dynamically loading a class in Java

I looked up the syntax and searched the api but am still confused about the process. I also searched Stackoverflow. What is the proper way to load a class and create an object out of it dynamically? In otherwords I want the user to specify what type of object they want to create, and then create that type of …

Returning ZipOutputStream to browser

I have an ZipOutputStream that I want to return to the browser. The experience I would like is that the user clicks an anchor tag, and then a file download prompt is displayed for the ZipOutputStream that I have. How do you get the ZipOutputStream back to the browser? Answer Just had to do this exact same thi…

Windows ignores JAVA_HOME: how to set JDK as default?

How do I persuade Windows to use the JDK instead of a JRE? This question has been asked before, here and elsewhere: How do I set the default Java installation/runtime (Windows)? The trouble is that Windows ignores JAVA_HOME and it also ignores the fact that I made the JDK bin directory the first entry in the …