Skip to content

Tag: windows

Setting JAVA_HOME

I’m having a problem when running programs that use Java from the command line. I get back a message saying Java.exe could not be found. I’ve followed the instructions found in several places for setting JAVA_HOME in Windows 7. As can be seen in the image I’m pointing to the JDK folder as in…

Extracting .jar file with command line

I am trying to extract the files from a .jar file. How do I do that using command line? I am running Windows 7 Answer From the docs: To extract the files from a jar file, use x, as in: To extract only certain files from a jar file, supply their filenames: The folder where jar is probably isn’t C:Java

Windows ignores JAVA_HOME: how to set JDK as default?

How do I persuade Windows to use the JDK instead of a JRE? This question has been asked before, here and elsewhere: How do I set the default Java installation/runtime (Windows)? The trouble is that Windows ignores JAVA_HOME and it also ignores the fact that I made the JDK bin directory the first entry in the …

How do I make HttpURLConnection use a proxy?

If I do this… it prints The problem is, I am behind a proxy. Where does the JVM get its proxy information from on Windows? How do I set this up? All my other apps seem perfectly happy with my proxy. Answer Since java 1.5 you can also pass a java.net.Proxy instance to the openConnection(proxy) method: If…

Ant is not able to delete some files on windows

I have an ant build that makes directories, calls javac and all the regular stuff. The issue I am having is that when I try to do a clean (delete all the stuff that was generated) the delete task reports that is was unable to delete some files. When I try to delete them manually it works just fine. The