Let's say that your (compact!) Riemann surface is $X$ (of genus at least $1$). What does it mean to say that $J^{g-1}$ is the "variety of degree $g-1$ line bundles?" One way to formalize this is to say that there is a line bundle $\mathcal{L}$ on the product $X \times J^{g-1}$ with the property the rule $p \mapsto \mathcal{L}|_{X \times \{ p \}}$ defines a bijection between the ($\mathbb{C}$-valued) points of $J^{g-1}$ and the line bundles of degree $g-1$. (A stronger statement is that $J^{g-1}$ represents the Picard functor, but I'm going to try to sweep this under the run.)
Let $\pi \colon X \times J^{g-1} \to J^{g-1}$ denote the projection maps. Recall that the formation of the direct image $\pi_{*}(\mathcal{L})$ does not always commute with passing to a fiber. However, the theory of cohomology and base change describes how the fiber-wise cohomology of $\mathcal{L}$ varies. The main theorem states that there is a 2-term complex of vector bundles
$d \colon \mathcal{E}_0 \to \mathcal{E}_1$
that computes the cohomology of $\mathcal{L}$ universally. That is, for all morphisms $T \to J^{g-1}$, we have
$\operatorname{ker}(d_{T}) = (\pi_{T})_{*}(\mathcal{L}_{X \times T})$
and
$\operatorname{cok}(d_{T}) = (R^{1}\pi_{T})_{*}(\mathcal{L}_{X \times T}).$
(The most important case is where $T = \operatorname{Spec}(\mathbb{C})$ and
$T \to J^{g-1}$ is the inclusion of a point.)
The complex $\mathcal{E}_{\cdot}$ is not unique, but any other complex of vector bundles with this property must be quasi-isomorphic.
In the literature, many authors construct a complex $\mathcal{E}_{\cdot}$ using an explicit procedure, but the existence is a very general theorem. I learned about this topic from Illusie's article "Grothendieck's existence theorem in formal geometry," which states the base change theorems in great generality.
In your question, you described how to convert the complex into a line bundle (take the difference of top exterior powers). But now we must check that two quasi-isomorphic complexes have isomorphic determinant line bundles. This can be checked by hand, but this statement has been proven in great generality by Mumford and Knudsen (see MR1914072 or MR0437541). The determinant of the complex $\mathcal{E}_{\cdot}$ is exactly the line bundle you are asking about.
One subtle issue is that the universal line bundle $\mathcal{L}$ is NOT uniquely determined. If $\mathcal{M}$ is any line bundle on $J^{g-1}$, then
$\mathcal{L} \otimes \pi^{-1}(\mathcal{M})$ also parameterizes the degree $g-1$ line bundles in the sense described above (and in a stronger sense that I am sweeping under the rug). However, one can show that $\mathcal{L}$ and $\mathcal{L} \otimes p^{*}(\mathcal{M})$ have isomorphic determinants of cohomology by using the fact that a degree $g-1$ line bundle has Euler characteristic equal to zero.
Added: Here is one method of constructing the complex. Fix a large collection of points $\{x_1, \dots, x_n\} \subset X$ (at least $g+1$ points will do), and let $\Sigma \subset X \times J^{g-1}$ denote the subset consisting of pairs $(x_i,p) \in X \times J^{g-1}$. The universal line bundle $\mathcal{L}$ fits into a short exact sequence:
$$
0 \to \mathcal{L}(-\Sigma) \to \mathcal{L} \to \mathcal{L}|_{\Sigma} \to 0
$$
Here $\mathcal{L}(-\Sigma)$ is the subsheaf of local sections vanishing along $\Sigma$ and $\mathcal{L}|_{\Sigma}$ is the pullback of $\mathcal{L}$ to $\Sigma$.
Associated to the short exact sequence on $X \times J^{g-1}$ is a long exact sequence relating the higher direct images under $\pi$. The first connecting map is a homomorphism
$d : \pi_{*}(\mathcal{L}|_{\Sigma}) \to R^{1}\pi(\mathcal{L}(-\Sigma))$
This is a complex $K_{\cdot}$ of vector bundles that compute the cohomology of $\mathcal{L}$ universally in the sense described earlier. Thus, its determinant is the desired line bundle.
Why is this true? There are two statements to check: that the direct images are actually vector bundles and that the complex actually computes the cohomology of $\mathcal{L}$. Both facts are consequences of Grauert's theorem. Indeed, the hypothesis to Grauert's theorem is that the dimension of the cohomology of a fiber $\pi^{-1}(p)$ is constant as a function of $p \in J^{g-1}$. Using Riemann-Roch (and the fact that we chose a large number of points), this is easily checked. The theorem allows us to conclude that both $\pi_{*}(\mathcal{L}|_{\Sigma})$ and $R^1 \pi(\mathcal{L}(-\Sigma))$ are vector bundles whose formation commutes with base change by a morphism $T \to J^{g-1}$.
An inspection of the relevant long exact sequence shows that the cohomology of the complex
is $\pi_{*}(\mathcal{L})$ and $R^1\pi(\mathcal{L})$ (i.e. the complex compute the cohomology of $\mathcal{L}$). We would like to assert that this property persists if we base-change by a morphism $T \to J^{g-1}$ and work with the complex
$K_{\cdot} \otimes \mathcal{O}_{T}$.
But we already observed that the formation of the direct images appearing in the complex commutes with base-change, and so the base-changed complex fits into a natural long exact sequence. Again, an inspection of this sequence shows that base-changed complex compute the cohomology of $\mathcal{L}|_{X \times T}$, and so the original complex computes the cohomology universally.