The value with which you must be concerned when designing against recoil is not energy but momentum.
The Kinetic Energy of a projectile is formulated with the equation:
where E is the kinetic energy, m is the mass of the projectile and v is the velocity.
Momentum, on the other hand, is calculated using this similar equation:
where p is momentum (from the Latin petere, or impetus), m is mass, and v is velocity.
The change in momentum of an object is known as Impulse. The Impulse-Momentum theorem and the Conservation of Momentum are largely used to calculate scenarios involving Newton's Third Law of Motion (Equal but Opposite Reactions, or Recoil if you prefer).
So Kinetic Energy and Momentum are clearly very similar values, but they are not quite the same. Specifically, if you have two guns that fire different projectiles, one is fast and light and the other is slow and heavy, the energies might be the same but the recoil will not be the same, or vice versa. This is due to the velocity squared we see in the Kinetic Energy equation. This means we need to define our projectile exactly in order to properly analyze this problem.
Now, with that out of the way, we can look at some history. There have, in fact, been weapons (projectile weapons, even) that have delivered kinetic payloads on the same order of magnitude as your railgun. Specifically, the Schwerer Gustav railway cannon used by Nazi Germany could deliver a payload of about 1.8 gigajoules (v = ~720 m/s, m = ~7100 kg). The recoil the weapon would experience was about 5,112,000 newton-seconds (a unit we don't really need to care about too much).
The astonishing energy delivered by the Great Gustav was largely achieved due to the massive projectile, and not so much due to the speed of the projectile. In theory, we could definitely reverse those attributes and launch a small projectile at hypersonic velocities. If we had a muzzle velocity of 1% the speed of light, for example, the projectile would only need to weight like a milligram to deliver a gigajoule of energy. Unfortunately we have an issue in this regard.
It turns out there is an upper limit to velocity while inside the atmosphere. Atmospheric Heating will literally vaporize things travelling too fast (which is one of the many reasons you can't launch satellites into space with a railgun). The fastest you can reasonably go is about 7000 m/s. Even at this speed most materials will vaporize too quickly to be useful, but super dense materials like Uranium or Iridium will survive well enough. With this speed as the upper bound, if we wanted to strike with 1 gigajoule the projectile would have to weigh about 40 kilograms. That's not super unreasonable, especially considering Great Gustav's shells weighed 7 tonnes.
With these numbers in mind, we can figure out how much impulse the railgun will produce when it fires: 280,000 newton-seconds. Compared to Gustav's figure, that number is paltry. To compare some others, the Mark 7 16"/50 guns aboard the Iowa Class Battleship produce a little over 1,000,000 newton-seconds of impulse. The primary weapon of the Abrams MBT produces about 10,000 newton-seconds of impulse.
So what does all this mean? In my opinion, a 1 gigajoule railgun would need to mounted aboard a small ship, or perhaps a very large self-propelled artillery piece (I'm fairly confident weapons like the M110 Howitzer produce similar recoil, but I could not find any definitive ballistic data). Large stationary artillery would also work, but such weapons were never really effective.
If I forgot something, or there is data I missed, please let me know!
EDIT: Turns out the M110 Howitzer produces about 50,000 newton-seconds of impulse, so I was actually mistaken about the magnitude of the recoil involved. This suggests a self-propelled artillery piece with our hypothetical 1GJ weapon will need a carriage much larger than used with the M110. I doubt it will need to be 5x bigger to manage the 5x recoil, but it will need to be significant.
EDIT 2: Ok one more edit! I found a weapon with a very similar recoil value: the German 28cm/45 SK L/45 Naval Gun. It generates an impulse of about 260,000 newton-seconds, which is close enough for our purposes. That link contains most of the relevant ballistic and dimensional data, but the long and short of it is that a weapon that size is usually mounted on a large ship (in this case it was the primary armament of some of Germany's Dreadnought-era capital ships) or as a fixed artillery piece (shore defense or railway cannon). In my humble opinion, it would be very difficult to mount this cannon on a tank, but at least some of that difficulty will be a result of the gun's weight. Our railgun will not have the same kinds of weight restrictions as a traditional cannon, though, so I think it's still feasible, especially if we're using modern materials and techniques.