Java控制面板代理设置-它们存储在哪里? [英] Java Control Panel Proxy Settings - where are they stored?

查看:55
本文介绍了Java控制面板代理设置-它们存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有...一种情况.想象一下,有许多PC(运行Windows 7至8)运行Java应用程序,该应用程序是使用.jnlp启动的.现在终于有了一个从Java 6到8的版本跳转(花了很多时间),突然这个应用程序不再启动了(无法解析第一个jnlp,javaws告诉我).

要解决此问题,我们必须在Java控制面板中插入正确的代理设置(旧版本不需要).所以...手动执行此操作是大多数用户无法执行的任务(很遗憾,他们的知识水平还不够),但是在所有PC机上独自执行操作会很费时...时间.

因此,我们决定创建一个小的批处理文件,该文件执行所有必需的工作(安装最新的jre,清除缓存等),而该文件仅需在每台用户PC上运行一次.理论上.

我们能够在.bat中放置所有必需的步骤,除了在Java控制面板上设置代理外.我不知道这是否可能.javaws参数不包含这样的参数,而且我无法在jre或Java缓存中找到物理存储.

恐怕我无法为该.jnlp文件使用这些-dHTTP.xxx ....标志,因为该Java webstart是需要知道正确的代理设置而不是应用程序的那个.

那么有没有办法通过一些命令行参数或类似的方法来更改可通过java控制面板访问的代理设置,从而使自己能够完成全新"脚本?

问候,困惑的梅林

解决方案

Java控制面板设置位于%userprofile%\ AppData \ LocalLow \ Sun \ Java \ Deployment \ deployment.properties

要添加代理,您可以使用类似的

 ((echo(deployment.proxy.bypass.local = true)(echo(deployment.proxy.type = 1)(echo(deployment.proxy.http.host = 10.10.10.10)(echo(deployment.proxy.http.port = 10))>>%userprofile%\ AppData \ LocalLow \ Sun \ Java \ Deployment \ deployment.properties" 

尽管如果已经设置了代理服务器,则需要替换数据.

I have... a situation. Imagine you have many, many PCs (Windows 7 to 8) that run a Java Application which is started by using a .jnlp. Now finally there has been a version-jump from java 6 to 8 (took way to much time), and suddenly this application wont start any more (can't parse first jnlp, javaws tells me).

To solve this we have to insert the correct proxy-setting inside java-control panel (wasn't necessary with the old version). So... doing this by hand is a task that most users can't perform (sadly their level of knowledge isn't sufficient), but doing ths by myself at all PCs would take... uh... a really long time.

So we decided to create a little batch-file, that does perform all the stuff necessary (installing latest jre, clearing cache and so on) which just has to be runned once at every users PC. In Theory.

We were able to place all steps necessary in that .bat, except for setting the proxy at the java control panel. I wonder if this is possible at all. The javaws arguments don't contain such an argument, and I wasn't able to find a physical storage whatever inside the jre or the java cache.

And I can't use these -dHTTP.xxx.... flags for that .jnlp file I'm afraid, because that java webstart is the one that need to know the correct proxy-settings, not the application.

So is there a way to change the proxy setting you can access with the java control panel by some command line argument or something like this, enabling myself to complete this "all new" script?

Greetings, ConfusedMerlin

解决方案

Java control panel settings are located in %userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties

to add proxy you can use something like

(
 (echo(deployment.proxy.bypass.local=true)
 (echo(deployment.proxy.type=1)
 (echo(deployment.proxy.http.host=10.10.10.10)
 (echo(deployment.proxy.http.port=10)
)>>"%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties"

though if there are already set proxy you'll need to replace the data.

这篇关于Java控制面板代理设置-它们存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆