The alphabet "j" is pronounced differently in the following major European languages:
- Spanish: justo
- English: just
- German: junge
- French: juste
How is the sound so varied in these languages?
The reason why the pronunciation is so different is because a phenomenon called phoneme change.
The term is used to design the process from which a language changes their phonetic system over time. It is a universal and inevitable process whereby the languages chance over time and whereby the stages of the language of different periods can develop intelligibility among them.
Assimilation: Process where a sound acquires phonetic features which make them more similar to an adjacent phoneme or a close phoneme, the phoneme is "assimilated"
Metathesis: It is the change of place of one or more sounds in the interior of a word. It responds to the need of making the pronunciation easier, like crocodilo ->cocodrilo.
Therefore, the languages you mentioned and asked about have changed over time because of the reasons above.
Note: Language has evolved vastly over time, Spanish of 200 years isn't the same as current Spanish. So if a language in a single country can change so much, imagine how could languages that have the same roots can also vastly evolve; specially when there is a far location among them.
I would reverse the question. How is it that such varied sounds came to be represented by the same letter? It is the oral language that is the natural language. The written language is added later.
In Spanish, the sound that is represented by the jota used to be represented by the equis. Examples: Mexico, Texas. The change was part of a general revision of spelling.