A 2D Layout Algorithm for Small, Sparse, and Undirected Graphs with a Specific Edge Length
"Planar Embeddings of Graphs with Specified Edge Lengths" by Cabello, Demaine, and Rote (or one of the references they cite) seems to solve your problem.

If you don't care about edges crossing too much, a simple heuristic approach could be gradient descent. Start with a random position and iteratively wiggle the nodes a bit to decrease the sum of differences of the current edge lengths to your desired lengths.