Just and only sometimes mean the same. If you had numbered your examples, 1, 4, 6 and 7 would be correct, with just and only being interchangeable and in the right position. But both words have a number of different meanings besides.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.