使用GreenDao 报"This check is to prevent accidental file generation into a wrong path."错误
2016-02-26 11:50
1021 查看
参考:/article/9448409.html
最近使用了GreenDao 第三方框架 。Github: https://github.com/greenrobot/greenDAO
结果在Demo练习中碰到了这么一个错误,
This program comes with ABSOLUTELY NO WARRANTY
Exception in thread "main" java.io.IOException: ../DaoExample/src/main/java does not exist. This check is to prevent accidental file generation into a wrong path.
at de.greenrobot.daogenerator.DaoGenerator.toFileForceExists(DaoGenerator.java:128)
at de.greenrobot.daogenerator.DaoGenerator.generateAll(DaoGenerator.java:86)
at de.greenrobot.daogenerator.DaoGenerator.generateAll(DaoGenerator.java:79)
at de.greenrobot.daogenerator.gentest.ExampleDaoGenerator.main(ExampleDaoGenerator.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Process finished with exit code 1
网上答案真的不多,再看了 /article/9448409.html 这篇博客之后,发现如果按照作者的意思来解决,路径是 ././{$ProjectName}/app/src/main/{$PackageName}
,如下图所示:
结果经过测试,发现仍旧会报如下的错误,如下图所示:
熟悉JAVA IO操作的朋友都知道,Windows中路径的表示
然后,我将路径改成这样:
./../{$ProjectName}/app/src/main/java-gen,
然后Run 发现成功了,
再次说明一下:
最近使用了GreenDao 第三方框架 。Github: https://github.com/greenrobot/greenDAO
结果在Demo练习中碰到了这么一个错误,
This program comes with ABSOLUTELY NO WARRANTY
Exception in thread "main" java.io.IOException: ../DaoExample/src/main/java does not exist. This check is to prevent accidental file generation into a wrong path.
at de.greenrobot.daogenerator.DaoGenerator.toFileForceExists(DaoGenerator.java:128)
at de.greenrobot.daogenerator.DaoGenerator.generateAll(DaoGenerator.java:86)
at de.greenrobot.daogenerator.DaoGenerator.generateAll(DaoGenerator.java:79)
at de.greenrobot.daogenerator.gentest.ExampleDaoGenerator.main(ExampleDaoGenerator.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Process finished with exit code 1
网上答案真的不多,再看了 /article/9448409.html 这篇博客之后,发现如果按照作者的意思来解决,路径是 ././{$ProjectName}/app/src/main/{$PackageName}
,如下图所示:
结果经过测试,发现仍旧会报如下的错误,如下图所示:
熟悉JAVA IO操作的朋友都知道,Windows中路径的表示
然后,我将路径改成这样:
./../{$ProjectName}/app/src/main/java-gen,
然后Run 发现成功了,
再次说明一下:
相关文章推荐
- 101道RHCE考题和详细答案
- 9种状态的设计
- iOS触动精灵模拟触控类外挂原理分析
- iOS 获取当前正在显示的ViewController
- PL/SQL之LOB类型和BIND变量
- '-[__NSCFArray insertObject:atIndex:]: mutating method sent to immutable object'
- 头文件防止重复定义方法
- iOS 9 学习系列: MapKit
- SQL Server2012如何更改服务器的名称
- 半年总结
- 【Bugly 技术干货】Android开发必备知识:为什么说Kotlin值得一试
- 常见模块(二)
- IOS--纯代码方式编写View
- 第十七章 提升用户体验 之 使用MVC扩展功能控制程序行为
- (转)手机端html5触屏事件(touch事件)
- Maven + Spring 进行多环境自动切换功能
- Oracle dmp文件导入
- pthread_join函数及linux线程
- iOS程序破解与调试基础
- 流程控制语句的识别