When I try to compile the below Latex document from Java, my pdflatex run crashes:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\pagestyle{empty}
%
\tikzstyle{int}=[draw, fill=blue!20, minimum size=2em]
\tikzstyle{init} = [pin edge={to-,thin,black}]
\begin{tikzpicture}[node distance=2.5cm,auto,>=latex']
\node [int, pin={[init]above:$v_0$}] (a) {$\frac{1}{s}$};
\node (b) [left of=a,node distance=2cm, coordinate] {a};
\node [int, pin={[init]above:$p_0$}] (c) [right of=a] {$\frac{1}{s}$};
\node [coordinate] (end) [right of=c, node distance=2cm]{};
\path[->] (b) edge node {$a$} (a);
\path[->] (a) edge node {$v$} (c);
\draw[->] (c) edge node {$p$} (end) ;
\end{tikzpicture}
\end{document}
pdflatex doesn't just produce some error, but it simply freezes. The log file is cut off in the middle, even before an enclosing quotation mark is completed (but always at the same position, I think).
I use this Java command to execute pdflatex:
Runtime.getRuntime().exec(command);
p.waitFor();
The command executed is:
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" -output-directory "C:\Eig\Lehre\Info2\ImagesTemp" "C:\Eig\Lehre\Info2\ImagesTemp\graph.tex"
Executing the command by hand in a command line works fine! Also, the Java execution works fine when I don't include tikz in the latex document. This seems quite strange to me - is there some bug or am I missing something?
I'm using Miktex 2.9 and Java 8 on Windows, I've tried it on different Windows versions.