2

I use the Eclipse IDE to do development work and would like to copy/rename the .classpath and/or .project files. Note that these files only have an extension and not a filename.

Windows won't let me change .classpath to .classpath.bak (or vice versa).

Is there some way to do this other than naming the files in a Unix server and copying them to my Windows machine?

6

In all current Windows versions, the extension is part of the filename. They have been a single field ever since Windows 95 introduced "Long File Names".

Although Windows Explorer refuses filenames starting with a ., this limitation does not apply to Command Prompt, PowerShell, or to alternative file managers such as Total Commander. (Eclipse itself should let you rename as well.)

For example, in Command Prompt you can use:

C:\> cd/d C:\Users\Fred\Projects

C:\Users\Fred\Projects\> ren .classpath .classpath.bak
-1

Just put an extra dot at the end of the filename. So, instead of renaming it to

.classpath

rename it to

.classpath.

  • Then it wouldn't be named .classpath – sdoca Oct 4 at 16:21
  • Have you at least tried it? This works even on the latest Windows 10 build (1903 atm). – Deivis Queirolo Vieira Oct 5 at 18:02
  • Still, it is not a new trick, as you can see here: stackoverflow.com/a/24136985/6182286 Microsoft fixed this on a previous update so you can just rename it to '.classpath' and it should work. – Deivis Queirolo Vieira Oct 5 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.