-2

I'm using java, and what I'm trying to do is this

:C:\Users\julio\workspace1\Assistant\lib\TAR2570\2570.lm

is use this file path in any other computer, because if i use this one, not every user is name Julio, with a workspace folder. I tried, deleting some of it, and just leaving :C:\Assistant\lib\TAR2570\2570.lm but When I run it, it says find not found if I take off the other parts.

Thank you in advance

  • Please see http://stackoverflow.com/questions/585534/what-is-the-best-way-to-find-the-users-home-directory-in-java. That would solve the problem of the home directory, but it probably won't solve your whole problem. If you want other users to be able to use your program, you might have to read a Windows environment variable, and then instruct other users to set the environment variable to a desired path to use for the workspace. Or package your program up in an installer that is able to ask the user for a path, and store the path in a properties file. – ajb Dec 04 '16 at 00:01
  • You need to learn about absolute (like the examples you gave) and relative paths. I think you want to use relative paths for your application, but the question is rather generic. Please use these terms 'absolute path' / 'relative path' to search for more information for your _real_ problem – Benjamin Podszun Dec 04 '16 at 00:04

1 Answers1

1

You are using an absolute path. You should be using a relative path. To do this move the 2570.lm file into the source package*. You can then access it in your application like /2570.lm.

*For example, if you are using Eclipse, you could move the file into the src folder of your project. Even better, you could create another source folder and name it something like externs and move it in there.

Community
  • 1
  • 1
ack
  • 1,181
  • 1
  • 17
  • 36