简体   繁体   English

Netbeans文件路径

[英]Netbeans file path

When creating a file in Java using Netbeans. 使用Netbeans在Java中创建文件时。

I have a file "C:\\myXml.xml" 我有一个文件“ C:\\ myXml.xml”

However due to the nature of a library I am using the xml needs to be placed in "\\data\\myXml.xml" when using Netbeans. 但是,由于库的性质,在使用Netbeans时,我正在使用的xml需要放置在“ \\ data \\ myXml.xml”中。

Where would this file path relate to? 该文件路径与哪里相关?

If I understood your question correct, you are asking where your file will be on the file system absolute path.. correct? 如果我正确理解了您的问题,那么您是在询问文件在文件系统绝对路径上的位置。 It will be in the project folder root/data/myXml.xml 它将位于项目文件夹root / data / myXml.xml中

Create a folder (eg data) and copy your data files to this folder 创建一个文件夹(例如数据)并将数据文件复制到该文件夹

Then in the Netbeans do the following: 然后在Netbeans中执行以下操作:

Project Properties Run Working Directory 项目属性运行工作目录

selecting your working directory. 选择您的工作目录。 Then run your project 然后运行您的项目

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

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