devxlogo

File.createTempFile()

File.createTempFile()

Question:
I am attempting to use createTempFile and it works fine with JDK 1.2.2,but IE 4 and 5, and Netscape give me the following error:

java.lang.NoSuchMethodError: java/io/File: methodcreateTempFile(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File; notfound.

Why is this?

Answer:
The latest version of Java supported by Microsoft Internet Explorerand Netscape Navigator/Communicator is JDK 1.1.x.File.createTempFile() is not present in JDK 1.1 and was only justadded in JDK 1.2 as part of the Java 2 Platform Specification.

You will need to use a Java 2 Plugin if you want to use JDK 1.2 featuresin applets. However, you will run into problems with the securitymanager because applets are generally not allowed to access the localfile system. You will have to familiarize yourself with thepermissions APIs specific to each browser to bypass this restriction.

See also  How to Create and Deploy QR Codes Online: A Comprehensive Guide
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist