Home > Back-end >  How to get the project root? (many project references)
How to get the project root? (many project references)

Time:03-12

there are two projects, RdrmCommonAppFrame and MscSpeechSynthesis
RdrmCommonAppFrame framework, based on the technique for project
MscSpeechSynthesis for application, such as
Want to call the project in the project B A, but no project in the project B with XML in A, pictures, etc.,
When the project is running, B may be an error by batch is less than the path of the resource file,
Copy resource file while it is possible to make the program, but RdrmCommonAppFrame lose portability,
Want to keep projects A portability, of which the path of the code must use A resource file relative to the path of the project. A project, then convert the absolute path, or when A project B runtime error,
For example, System. GetProperty (" user. Dir "); You can get the root path of the project, but if it is project B calls A method, or the path of the project B, or the items at this time I need A path,
If through the project A Class file path can be absolute path, but if the Bin folder Settings, is not the default, the project B didn't know A change, still complains, code portability is still poor, and RdrmCommonAppFrame eventually be packaged into A Jar,
How to get in MscSpeechSynthesis RdrmCommonAppFrame root path
  • Related