Bfg-repo-cleaner: Where do I put bfg.jar?

Created on 1 May 2017  路  5Comments  路  Source: rtyley/bfg-repo-cleaner

I figured I'd have to rename the file I downloaded to bfg.jar. I'm following the instructions, and when I try to use bfg I get an error.

$ java -jar bfg.jar
Error: Unable to access jarfile bfg.jar

I guess this may be more of a Git Bash question than a bfg question, but where do I put bfg.jar to make it accessible to Java? It works if it's in my project's working directory but since bfg isn't specific to my project I'd like it in a more global location.

I'm using Windows 10 64-bit.

Most helpful comment

The simple way to create alias that work for me is to make a new folder named C:\Aliases.
Put bfg.jar in there.
Create a batch file bfg.bat.
Inside the file, you paste this content:

@echo off
echo.
java -jar %~dp0\bfg.jar %*

Make sure you add C:\Aliases to PATH environment variable.
Then you can call bfg inside command prompt.

https://gist.github.com/off99555/d6a4ee85314971ef6cc9f4f8d9414d07

All 5 comments

Just put it anywhere you like and provide the full path to it in the command line.

There's no special jar path like there is for executables so that you don't have to type it all out?

No. The BFG docs suggest creating an alias (or wrapper-script) bfg which can hide the location of bfg.jar.

Thanks.

The simple way to create alias that work for me is to make a new folder named C:\Aliases.
Put bfg.jar in there.
Create a batch file bfg.bat.
Inside the file, you paste this content:

@echo off
echo.
java -jar %~dp0\bfg.jar %*

Make sure you add C:\Aliases to PATH environment variable.
Then you can call bfg inside command prompt.

https://gist.github.com/off99555/d6a4ee85314971ef6cc9f4f8d9414d07

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmsaavedra picture jmsaavedra  路  5Comments

cnmade picture cnmade  路  7Comments

Sieabah picture Sieabah  路  4Comments

funct7 picture funct7  路  4Comments

esend7881 picture esend7881  路  6Comments