导出之前要把项目提前编译build clean 和 maven build
导出的步骤:
1.选中项目,右键选择[Export]
2.选择[java]-[Runnable JAR file]
3.如果Lanch-configuration没有选项,那肯定是项目没有提前编译运行过
4.结果如下:
可能出现的报错:
1.Select a 'Java Application' launch configuration to use to create a runnable JAR.
方法:你先要把这个项目进行编译运行才能看到
2.Class files on classpath not found or not accessible for
方法:先clean,再build,如果还不行,删除项目,重新导入了一次,再次编译运行,classes里面有内容了
3. Resource is out of sync with the file system
解决方法:
有两种解决方法:
1)手动刷新。即在eclipse的工程目录中,右键refresh(或者按下F5)。
2)配置eclipse的选项:
a)eclipse启动时,刷新workspace,即勾选:window—>preferences—>general—>startup and shutdown—>refresh workspace on startup;
b)window—>preferences—>general—>workspace中:勾选选项:refresh using native hooks or polling和refresh on access;
参考:
https://blog.csdn.net/yukon12345/article/details/6831677
https://blog.csdn.net/reille/article/details/7106195
https://www.cnblogs.com/daguozb/p/9081112.html