[Tex/LaTex] Line breaking of URLs in bibliographies

bibliographieshorizontal alignmentline-breakingurls

I have a problem with the line break of an URL. The URL can´t break correct and extends into the border. I´ve tried some things. Amongst others I loaded the package breakurl, but without any success. When I set the bibliography left-aligned there isn´t a problem. But I need it justified. Here is an example:

\documentclass[
a4paper,                         
fontsize=11,                    
BCOR=10mm,
DIV=11
]{scrreprt}

\usepackage[ngerman]{babel}                    
\usepackage[latin1]{inputenc}                
\usepackage[T1]{fontenc}
\usepackage{lmodern}                        
\usepackage{microtype}    
\usepackage[
    style=numeric, 
    maxnames=1,
    bibencoding=latin1,
    backend=bibtex8,
    defernumbers=true,
    hyperref=true,
    alldates=long
]{biblatex}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}

\begin{filecontents}{bachelorarbeit_lit.bib}
@ONLINE{java96,
    author = {{Sun Microsystems}},
    title = {JavaSoft ships Java 1.0},
    year = {1996},
    month = {1},
    url = {http://findarticles.com/p/articles/mi_m0EIN/is_1996_Jan_23/ai_17853565/?tag=content;col1},
    urldate = {2011-03-02},
    sortname = {Sun},
    keywords = {www}
}

@ONLINE{java02,
    author = {{Computer Weekly}},
    title = {Write once, run anywhere?},
    year = {2002},
    month = {5},
    url = {http://www.computerweekly.com/Articles/2002/05/02/186793/Write-once-runanywhere1.htm},
    urldate = {2011-03-02},
    sortname = {Computer},
    keywords = {www}
}
\end{filecontents}

\bibliography{bachelorarbeit_lit}

\begin{document}
\chapter{Test}
Test \cite{java02}
Test \cite{java96}

%\raggedright
\printbibliography
\end{document}

Does anyone have an idea?

Best Answer

The first URL has a large unbreakable section (runanywhere1) which must either form the end of the second or the beginning of the third line (given the specific font size, margin etc. of the example) if one insists on justified text. An acceptable (?) solution may be obtained by adding e.g. \sloppy or \emergencystretch 1.5em before \printbibliography. enter image description here

Related Question