Ok... Got already some mistakes:
Building target "MakeTraffic" with build style "Development"
(optimization:level 'N/A', debug-symbols:off) - (2 errors)
frameworkjars=""
for i in `echo ` ; do if [ -f "$i" ] ; then
frameworkjars="$frameworkjars":"$i" ; fi ; done
classpath="/Users/sdz/Desktop/Tempora¨res
Verzeichnis/XCode/maketraffic/MakeTraffic/build/MakeTraffic.build/MakeTraffic.build/JavaClasses$frameworkjars:"`/usr/bin/javaconfig
DefaultClasspath`
/usr/bin/javac -J-Xms64m -J-XX:NewSize=4M -J-Dfile.encoding=UTF8
-g -encoding MACINTOSH -sourcepath "/Users/sdz/Desktop/Tempora¨res
Verzeichnis/XCode/maketraffic/MakeTraffic/." -classpath "$classpath"
-d "/Users/sdz/Desktop/Tempora¨res
Verzeichnis/XCode/maketraffic/MakeTraffic/build/MakeTraffic.build/MakeTraffic.build/JavaClasses"
'@/Users/sdz/Desktop/Tempora¨res
Verzeichnis/XCode/maketraffic/MakeTraffic/build/MakeTraffic.build/MakeTraffic.build/JavaFileList'
MakeTraffic.java:6: cannot resolve symbol
symbol : constructor URL (java.lang.String,java.lang.String)
location: class java.net.URL
URL image = new URL("www.darknob.de","IMGA0356.JPG");
^
MakeTraffic.java:13: cannot resolve symbol
symbol : method close ()
location: class java.net.URLConnection
con.close();
^
2 errors
MakeTraffic.java:6: cannot resolve symbol
symbol : constructor URL (java.lang.String,java.lang.String)
MakeTraffic.java:13: cannot resolve symbol
symbol : method close ()
With that Source code:
import java.net.*;
import java.io.*;
class MakeTraffic {
MakeTraffic () {
URL image = new URL("www.darknob.de","IMGA0356.JPG");
URLConnection con = image.openConnection();
con.setDoInput(true);
con.setUseCaches(false);
InputStream stream = con.getInputStream();
//
stream.close();
con.close();
}
public static void main(String [] args) {
new MakeTraffic();
}
}
Any idea?
> MakeTraffic.java:6: cannot resolve symbol
> symbol : constructor URL (java.lang.String,java.lang.String)
> location: class java.net.URL
> URL image = new URL("www.darknob.de","IMGA0356.JPG");
You need to take a look at the documentation for the classes you are
using. On my Mac, for 1.4.2 with the dev tools and java dev tools
installed, they are in
file:///System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Resourc
es/Documentation/Reference/doc/api/java/net/URL.html .
In this case, there is no (String,String) constructor for URL. There is
an URL(String host, int port, String file), and an URL(String), among
others.
> ^
> MakeTraffic.java:13: cannot resolve symbol
> symbol : method close ()
> location: class java.net.URLConnection
> con.close();
Again, read the javadocs. Do you see a "close" method in your jdk
javadocs? If not, then it does not exist and cannot be used.
The javadocs are a good thing to peruse when you get error messages, as
they often contain interesting facts about how to use the classes in
question. If they do not contain enough information, go hunting for
tutorials. I find the Sun-provided ones pretty good.
Scott