Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: File.createTempFile() throws exception on Win7

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default File.createTempFile() throws exception on Win7

    When i call File.createTempFile() on a Win7 system it throws the following exception. This happens when i run my application as a windows service. If i run the application just as a simple java application then it works fine.

    java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Nati ve Method)
    at java.io.File.checkAndCreate(Unknown Source)
    at java.io.File.createTempFile(Unknown Source)
    at java.io.File.createTempFile(Unknown Source)
    at com.ultravisual.app.client.CmdLineContextAdapter.g etImageData(CmdLineContextAdapter.java:260)
    at com.ultravisual.pcm.routing.RoutingService.runIter ation(RoutingService.java:357)
    at com.ultravisual.pcm.routing.RoutingServiceWindowsR unner.run(RoutingServiceWindowsRunner.java:168)
    at java.lang.Thread.run(Unknown Source)

    Both System environment (TEMP, TMP) variables are set to C:\Windows\Temp.
    Both User environment (TEMP, TMP) variables are set to %USERPROFILE%\AppData\Local\Temp.

    Also i confirmed that both these directories exist on the workstation.

    I would really appreciate if somebody could help me out with this problem


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: File.createTempFile() throws exception on Win7

    Just a thought, are those directories admin protected? I know Win7 and Win Vista are crazy about that sort of thing. If they are admin protected, you will need to pass the admin rights or execute the program as administrator.

Similar Threads

  1. Exception during xml validation
    By vijeta in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 6th, 2010, 02:50 AM
  2. Reserved word "throws"
    By Lil_Aziz1 in forum Exceptions
    Replies: 1
    Last Post: January 1st, 2010, 01:12 AM
  3. Error of "ClassNotFound Exception"
    By multicoder in forum Exceptions
    Replies: 3
    Last Post: July 1st, 2009, 02:58 PM
  4. exception while Read very large file > 300 MB
    By ps.ganesh in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: June 11th, 2009, 11:39 PM
  5. Exception handling
    By AnithaBabu1 in forum Exceptions
    Replies: 6
    Last Post: August 27th, 2008, 09:37 AM