Using a global solver (bmibnb/gurobi7baron) will simply be extremely computationally demanding, so if global optimality isn't of utmost you should simply use a local solver
If you still want to use the global nonconvex quadratic solver in gurobi, assuming J and Jref are quadratic, you simply introduce a new variable e, use the objective e^2, and add the constraint e==J-Jref