如何讓 Java 小程式寫入臨時資料夾? (視窗)

如何讓 Java 小程式寫入臨時資料夾? (視窗)

有一個舊的 Java 小程式可以與 XP 一起使用。但如果您從 Windows 7 和任何 Java 外掛程式開啟它,它將無法運作。該插件本身會導出一些資料...作為 Excel 工作表。小程式已下載,但出現 IOException。

這是調試日誌:

basic: Applet initialized
basic: Starting applet
basic: completed perf rollup
basic: Applet made visible
basic: Applet started
basic: Told clients applet is started
/tmp/dixtemp1234.dat
C:\Users\X\AppData\Local\Temp\\001.TXT
network: Cache entry not found [url: http://domain/cgi-bin/viewLog.cgi?pg=5&UID=001&StartTime=1348153140&EndTime=1348239540&SampleTime=900&ID=2368%7C3368%7C12368%7C13368%7C19368%7C20368%7C, version: null]
network: Connecting http://domain/cgi-bin/viewLog.cgi?pg=5&UID=001&StartTime=1348153140&EndTime=1348239540&SampleTime=900&ID=2368%7C3368%7C12368%7C13368%7C19368%7C20368%7C with proxy=DIRECT
network: Connecting http://domain/ with proxy=DIRECT
network: Connecting http://domain/cgi-bin/viewLog.cgi?pg=5&UID=001&StartTime=1348153140&EndTime=1348239540&SampleTime=900&ID=2368%7C3368%7C12368%7C13368%7C19368%7C20368%7C with cookie "user=Admin"
Exception in comm thread: java.io.FileNotFoundException: \tmp\temp1234.dat (The system cannot find the path specified)

我找到了一些連結...
http://doc.sumy.ua/prog/java/javanut/ch16_01.htm
此頁面說我必須使用“屬性”文件。但我無法建立.hotjava資料夾,因為在 NTFS 上不可能這樣做。我嘗試將 xls 檔案儲存到我的臨時資料夾中,或「公共」下,等等。但這不起作用。

我得到的錯誤:https://i.stack.imgur.com/HsxgQ.jpg

Ps.:單一使用者會使用這個東西,所以我不能只使用安裝了XP的VM。泰。

答案1

嘗試將您擁有的任何引用變更為\tmpc:\tmp包含您正在使用的特定磁碟機。

相關內容