问题描述
我正在使用 libgdx 项目创建器 (gdx-setup.jar) 来设置一个新项目.但是,我在我的 Windows 机器上使用代理连接来访问 Internet,并且 gdx-setup.jar 无法检测到设置,因此我无法下载所需的 jar 文件并生成任何项目.我如何以及在哪里更改 java 代理设置,以便能够实现这一点?
I am using the libgdx project creator (gdx-setup.jar) to setup a new project. However, I am using a proxy connection on my Windows machine to access the internet and the gdx-setup.jar isn't able to detect the settings, thus I cannot download the required jar files and generate any project. How and where do I change the java proxy settings so that I am able to achieve this?
PS:我已经尝试在控制面板->Java->网络设置下编辑设置,但无济于事.
PS: I have already tried to edit the settings under Control Panel->Java->Network Settings but to no avail.
推荐答案
来自 Gradle 的手册:12.3.通过代理访问网络
From Gradle's manual: 12.3. Accessing the web via a proxy
您可能需要创建一个 $HOME/.gradle/gradle.properties 文件.例如:
You may need to create a $HOME/.gradle/gradle.properties file. For example:
systemProp.http.proxyHost=10.0.0.1
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=
systemProp.http.proxyPassword=
systemProp.http.nonProxyHosts=*.some.domain.com|localhost
重要提示:HTTPS 有单独的设置.
IMPORTANT: There are separate settings for HTTPS.
systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
然后,像这样运行设置:
Then, just run setup like this:
java -Dhttp.proxyHost=10.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=10.0.0.1 -Dhttps.proxyPort=8080 -jar gdx-setup.jar
这对我有用,在 HTTP 代理后面.使用您的代理设置进行更改.
This works for me, behind a HTTP Proxy. Change it with your proxy settings.
稍后,将您的项目导入 Eclipse.并确保您的 Eclipse 网络代理也正常.
Later, import your projects into Eclipse. And make sure your Eclipse Network Proxy is OK too.
这篇关于如何通过代理设置 libGDX 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)