Facing issues while installing Artifactory or upgrading Artifactory in windows with space in Folder/Directory.
Installed the Artifactory under “D:Program Files” folder and while running an Artifactory.bat file you may observe the error "could not find or load main class filesartifactorybin"
By default, Windows has a feature to create a short path for folders to resolve such issues, hence, you can make use of this option.
In the first place, we recommend you to make sure there is no space between the folder where you have set an environment variable, if there is space with an environment variable it would cause an issue while running an artifactory.bat during the fresh installation and while using migrate.bat script during the Artifactory upgrade. When setting the ARTIFACTORY_HOME and JFROG_HOME variables, make sure to use Windows short name.
If it is a Windows 64-bit system, Kindly change and set the environment variable as shown in the below.
Progra~3 = 'Program Files'
Progra~4 = 'Program Files(x86)'
Screenshot for setting the environment variable using shortname as a reference:
>>Click OK and Apply Changes as prompted.
>>You'll need to close and re-open any command windows that were open before you made these changes, as there's no way to reload environment variables from an active command prompt. If the changes don't take effect after reopening the command window, restart the Windows machine.
Once the Short namespace is set for the folder or the directory, you could run the Artifactory.bat script successfully.
You may not be able to use the short name feature in Windows Drive and observe “system cannot find the path specified" error.
As you are not able to use the shortened names for the other Drives, either it is disabled or not set. However, you can create a short Path for the folder/directory manually in the drive using the below commands.
1. Run the command in administrative mode:
fsutil 8dot3name query
>if you get a response like “Registry state is 1” then it's disabled.
>If you get a response like “Registry state is 0” then it's enabled. If it is disabled, then you need to enable it before you can create a short path.
2. To enable the short name feature using the command.
fsutil behavior set disable8dot3 0
3. To create a new short path for a folder, you need to use a command with generic syntax:
fsutil file setshortname <Path> <Shortname>
fsutil file setshortname “D:\Program Files” Progra~3
4. Now do a listing using "dir /x" and you should be able to see the short name of your folder in the command terminal.
5. Once the short path is set. If you wish to, disable this feature again using the command.
fsutil behavior set disable8dot3 1
6. Set the environment variable in Windows as per the short name created and close the command prompt and reopen.
Close and re-open any command windows that were open before you made these changes, as there's no way to reload environment variables from an active command prompt. If the changes don't take effect after reopening the command window, restart the Windows machine.
Run the Artifactiory.bat script now.