重新配置了studio 的工作環境, 沒問題,后來加需求要新增java類和接口,這就出現問題了,新建的時候,就會報錯:
Unable to parse template "Interface" Error message: This template did not produce a Java class or an interface
根據template報錯,打開file->setting->file and templates 發現里邊的templates 全部是空的,class沒有模板, 從別人那里考了一份出來粘貼上,發現可以新建類了,ok,問題得到解決。
但是過幾天發現又出問題了,再次打開studio,發現templates又空了,總不能每次開IDE都重新復制一次
最終的解決辦法如下:
打開studio所在的文件夾(在這之前請關閉studio),
在bin文件夾下找到這個文件
studio.exe.vmoptions
使用記事本打開這個文件
添加下面這句話:
-Djdk.util.zip.ensureTrailingSlash=false
保存, 重啟studio,打開file and templates,發現所有的templates 都存在了 。
原文地址: https://blog.csdn.net/renhaijuniryfe/article/details/78629942