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: I have already tried to edit the settings under Control Panel->Java->Network Settings but to no avail.
From Gradle's manual: 12.3. Accessing the web via a proxy
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
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
This works for me, behind a HTTP Proxy. Change it with your proxy settings.
Later, import your projects into Eclipse. And make sure your Eclipse Network Proxy is OK too.
Here is a working solution:
http://badlogicgames.com/forum/viewtopic.php?t=16414&p=70348
For windows 7, gradle.properties is under C:\Users\USER_NAME.gradle\ (or create one if not exist)
Steps:
1. prepare gradle.properties file with following content
org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx1500m
org.gradle.configureondemand=true
systemProp.http.proxyHost=
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=
systemProp.https.proxyPort=8080
run the jar through the same proxy
java -Dhttp.proxyHost=**** -Dhttp.proxyPort=** -Dhttp.proxyUser=******** -Dhttp.proxyPassword=**** -jar gdx-setup.jar
If you run gdx-setup.jar from the command line, you should be able to tell the JVM to use the proxy settings using http.proxyHost and http.proxyPort.
See: How do I set the proxy to be used by the JVM for more information.
The command line would be something similar to:
java -Dhttp.proxyHost=10.0.0.1 -Dhttp.proxyPort=8080 -jar gdx-setup.jar
I was able to workaround this problem using Eclipse with proxy configured in
Window -> Preferences -> Network Connections
I think it should be possible also in other IDEs or even Gradle (if you install it manually), provided that they have properly configured proxy.
This is because the Project Creator creates the whole directory structure, classes, etc., it fails later, when trying to download Gradle.
What I did after it failed is I went to Eclipse, I chose 'Import as Gradle project' and then clicked the Build Project button.
This downloaded Gradle and all the needed jars.
Related
Im using eclipse Neon and working behind a proxy. Below message boxes are displayed when im trying to create a maven project using an archetype.
"Could not resolve archetype XXXXXXXX from any of the configured repositories."
"Creating xxxxx has encountered a problem. Could not resolve archetype xxxx from any of the configured repositories"
I have configured the below settings correctly.
1. Proxy settings in Eclipse
2. Proxy settings in maven setting.xml file
3. Add the remote catalog as "http://repo1.maven.org/maven2/archetype-catalog.xml"
However, when i go to error description, it says "unexpected end of stream on connection" and it shows my proxy IP and port. Just to check, i have altered proxy IP in the setting.xml file and eclipse proxy setting but it shows the same IP and PORT in the error description without any change. I have no idea from where maven refers the proxy settings. Please advice.
Thanks in Advance
The same error made me struggle alot, I could download testNG and other things from eclipse marketplace, but when i'm creating a maven project i got this error. Because my internet connection is going through proxy.
I tried all the above but i couldn't resolve this error, but this guy gave me the solution:
http://www.javahelps.com/2015/08/set-proxy-for-maven-in-eclipse.html
After the above procedure is done, then you have to delete the existing quickstart-archetype from below folder
C:\Users.m2\repository\org\apache\maven\archetypes
then restart the eclipse and create a new maven project with new project name.
Since this is only a proxy issue, so no need to specify the arche types and all. This should work if it's a proxy related issue.
Try the following :
1) Delete your repository at C:/Users/????/.m2/repository
2) Check your C:/Users/????/.m2/settings.xml for correct proxy config
3) Set you M2_HOME environment variable to <MAVEN INSTALL DIR
4) Add %M2_HOME%/bin: to your PATH variable assuming windows (remeber to start a new window after changing ebvironment variables)
5) Try a mvn clean install from the command line - GET THIS WORKING FIRST
6) Then try from netbeans, you do not need a proxy setting it should call the default mvn.
Set proxy setting in eclipse neon as follows:
Window->Preferences->General->Network Connection
Now select Active Provider as Manual.
Now you will get three proxy entries to be configured HTTP, HTTPS and SOCKS. Configure host name, port, username and password in HTTP and HTTPS proxy entries, but not in SOCKS. Try this, it may help.
Also make sure the username and password you are typing is correct.
After configuration please restart eclipse, it is required for taking the effect of configuration.
Proxy setting in .m2/settings.xml may not be required after above setting.
I have just installed netbeans on my windows 7 computer.
This is the first time i have used netbeans!
I am trying to compile a program what is using maven to manage its dependencies.
The problem is i cant seem to compile the program as maven is unable to connect to the URL http://repo.maven.apache.org/maven2
I can get to this directly using a web browser
Now i am sure this is a proxy problem as i also have the same code on a Linux box and i can compile that, and i did have to setup the proxy.
I know maven has its own proxy setting in the settings.xml file and i have edited that with what i believe to be the correct details.
The settings file is in the root folder of my project.
I have also setup the proxy in Netbeans IDE (and pressing the test button works)
But i still cannot compile it on my windows box.
So my question are:
How do I correctly set up the maven proxy when using netbeans?
How can I check to see if my proxy setting are A) correct and B) being used!
It turns out its very easy!
My problem is that the code was put on my hard drive as a simple HG repository.
This means that i had a settings.xml file but it was in the solution folder, along with my pom.xml.
To fix my problem you need to:
Go to the projects tab in Netbeans
Right click the Project Files
Choose create settings.xml
This makes a new settings file in C:\Users\.m2
I then copied and pasted the content from my root settings.xml into this new settings.xml
And Bingo! it works.
I just need to remember to make changes to both settings files so that a working settings document can be saved into source control.
I think I had the same issue Win7/NetBeans/Maven.
Looks to me like Maven needs its own proxy settings and doesn't use the once which are set in NetBeans.
There's a settings.xml in a subdirectory where you installed NetBeans: e.g. c:\NetBeans 8.2\java\maven\conf
Don't forget to remove the surrounding comments from the proxy section.
I am trying to run a glassfish local server from Intellij Idea and have some troubles. The server only wants to run from terminal via sudo command, and the Intellij runs by default without sudo, so how do I fix it? Do I have to make the file to always get executed as sudo(if yes, then how) or should I set in the Idea configs to run that specific file as sudo?
All information consists in this guide: "Run/Debug Configuration: GlassFish Server".
I solved this by unzipping this to my home directory and changed the location of glassfish inside idea to the new location.
I'm wondering if there is an easy way to test my code on remote boxes.
What I'd like to do:
Edit my code in Eclipse locally.
Set up a run configuration that points at a remote host (with login
credentials).
Click "run" and have it just work.
The IDE would connect via SSH, copy over or synchronize all of the files in the project to the remote box, run the java command remotely, and let me step through the code in my local IDE.
Possible?
I use Eclipse, but I'd pay for Intellij IDEA if it would do this one thing.
IntelliJ Idea has remote debugging feature.
There is a "remote" debug configuration option available
Run > Debug > Edit Configuration > Add New > Remote
. You have to provide server configuration and connection parameters.
Both the Community Edition and Ultimate Editions have this feature.
I hope this is the feature you are looking.
I am following this tutorial:
https://spring.io/guides/gs/rest-service/
After completing the tutorial I run everything in my web browser on my local host and everything seems to work.However when I make changes in the java code (I made errors on purpose) I can still run everything in the web browser. What do I need to do in order for it to change due to my code changes? I guess I should mention that I am using eclipse and have installed maven as a plugin.
You are changing the source code, but not the compiled files. Your service is using the created "gs-rest-service-0.1.0.jar" file. This is not affected by your code changes.
Jump into the tutorial again where it says:
"Build an executable JAR"
This will rebuild your jar file. Afterwards you will have to restart your service like you did in the chapter "Run the service".
Instead of using maven as a plugin a choose to install it in order to use the command prompt.