Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Applets
Expertise: Beginner
Sep 21, 1999

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: method
createTempFile(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File; not
found.
Why is this?

Answer:
The latest version of Java supported by Microsoft Internet Explorer and Netscape Navigator/Communicator is JDK 1.1.x. File.createTempFile() is not present in JDK 1.1 and was only just added 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 features in applets. However, you will run into problems with the security manager because applets are generally not allowed to access the local file system. You will have to familiarize yourself with the permissions APIs specific to each browser to bypass this restriction.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap