简体   繁体   English

Eclipse EE上的相对路径

[英]Relative path on Eclipse EE

I'm doing a project in Eclipse EE and tried to give the relative path to take a file to use as a template to generate a JasperReport report, but not giving me errors. 我正在Eclipse EE中做一个项目,并尝试给出相对路径以采用文件作为模板来生成JasperReport报告,但没有给我错误。 But if I give an absolute like "D: \\ \\ template" does not fail. 但是,如果我给出一个绝对的“ D:\\\\模板”,则不会失败。

My question is how do I tell you to choose the relative path to a folder called "Template-report" that is in: >> src >> project name-reports >> template.jasper templates. 我的问题是如何告诉您选择文件夹“ Template-report”中的相对路径,该文件夹位于:>> src >>项目名称-报告>> template.jasper模板。

regards 问候

Relative paths in application launched from Eclipse are resolved relative to the application's working directory. 从Eclipse启动的应用程序中的相对路径是相对于应用程序的工作目录来解析的。 By default, this is the (file system) directory that corresponds to the project, but you can alter it using the application launcher configuration. 默认情况下,这是与项目相对应的(文件系统)目录,但是您可以使用应用程序启动器配置对其进行更改。

This Q&A offers an alternative approach (I think): Default eclipse working directory 此问答提供了一种替代方法(我认为): 默认Eclipse工作目录

您可以尝试使用eclipse变量来引用项目到工作区中,看看这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM