For an embedded Jena application using its modern JDK stack, establish a common fallback before building query executions or starting workers:

import java.net.InetSocketAddress;
import java.net.ProxySelector;
import org.apache.jena.http.HttpEnv;

var http = HttpEnv.httpClientBuilder()
    .proxy(ProxySelector.of(
        new InetSocketAddress("proxy.example.net", 8080)))
    .build();

HttpEnv.setDftHttpClient(http);

Jena's builder preserves its transport defaults while adding the selector. For an embedded workload using permitted public SPARQL endpoints and no proxy account, the HTTP proxy list can supply the selector’s HTTP address. This remains a shared JVM default, not a per-request switch.

OperationClient selection order
Ordinary HTTP query builderExplicit client, URL-based registry match, HttpEnv default
Built-in federated SERVICEMatching registry client, query-context client, global default

A local or registry override can therefore use another route. The HTTP builder resolves its client when build is called and passes that object into execution; replacing the default later does not rewrite an already built execution.

Keep the startup fallback stable. Use the appropriate local/context/registry interface when routes differ.

A standalone Fuseki server also needs its deployed version's supported way to run initialization. Putting this Java code in a file does not make that server execute it.

Artihkkalat mat laktásit