Programmfehler bei grundlegenden Funktionen

sebbib85

Mitglied
Hallo,

ich erhalte beim Compilieren mit dem javac-Programm diverse Fehlermeldungen unter Sun0S (Unix, SPARC, 64 Bit), die ich mir nicht erklären kann, da unter Windows XP (32 Bit) alles bestens liebt. Liegt es vielleicht an der Version. Installiert ist auf dem SunOS-Rechner Java 1.4 . Vielleicht könnt ihr mir helfen.
Selbst grundlegende Funktionen liefern einen Fehler. Hier die Fehlermeldungen:

-----------------
Visual_Plane.java:143: cannot resolve symbol
symbol : method addAll (java.util.Vector,float[],float[])
location: class java.util.Collections
Collections.addAll(vector, xray, yray);
^
Visual_Plane.java:190: cannot resolve symbol
symbol : method addAll (java.util.Vector,int[],int[],int[],int)
location: class java.util.Collections
Collections.addAll(vector, i1ray, i2ray, i3ray, ntri);
^
./Config.java:31: incompatible types
found : java.lang.Integer
required: int
this.x_res = Integer.valueOf( in.get_prop(config_fn, "XRES") );
^
./Config.java:32: incompatible types
found : java.lang.Integer
required: int
this.y_res = Integer.valueOf( in.get_prop(config_fn, "YRES") );
^
./Config.java:72: replace(char,char) in java.lang.String cannot be applied to (java.lang.String,java.lang.String)
input_name = files_dir + input_name.replace("-bin", "") + "_orb_plane";
^
./Input.java:161: cannot resolve symbol
symbol : method split (java.lang.String)
location: class java.lang.Object
col_size = Integer.valueOf(vif.elementAt(0).split(" ++")[0]);
^
./Input.java:161: incompatible types
found : java.lang.Integer
required: int
col_size = Integer.valueOf(vif.elementAt(0).split(" ++")[0]);
^
./Input.java:174: incompatible types
found : java.lang.Float
required: float
hdl_f[j] = Float.valueOf(hdl_s[j]);
^
./Output.java:31: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
this.year_s = String.format("%04d", (int)year);
^
./Output.java:32: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
this.hour_s = String.format("%02d", (int)hour);
^
./Output.java:33: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
this.min_s = String.format("%02d", (int)min);
^
./Output.java:34: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
this.doy_s = String.format("%03d", (int)doy);
^
./Output.java:35: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
this.duration_s = String.format("%03d", (int)duration);
^
./Output.java:36: cannot resolve symbol
symbol : method format (java.lang.String,float)
location: class java.lang.String
this.meridian_s = String.format("%5.1f", meridian);
^
./Output.java:37: cannot resolve symbol
symbol : method format (java.lang.String,float)
location: class java.lang.String
this.meridian_s2= String.format("%5.1f", meridian2 > 360 ? meridian2 - 360 : meridian2);
^
./Output.java:74: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
hour_time = String.format("%02d", hour_localtime);
^
./Output.java:75: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
hour_time2 = String.format("%02d", hour_localtime2);
^
./Output.java:76: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
min_time = String.format("%02d", min_localtime);
^
./Output.java:205: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
Dislin.mylab("1.e+" + String.format("%02d", i + 5), i, "z");
^
./Output.java:255: crvtri(float[],float[],float[],int,int[],int[],int[],int) in de.dislin.Dislin cannot be applied to (float[],float[],float[],int,int[],int[],int[],java.lang.Integer)
Dislin.crvtri( (float[])vec_transf.elementAt(0),
^
./Output.java:273: confll(float[],float[],float[],int,int[],int[],int[],int,float[],int) in de.dislin.Dislin cannot be applied to (float[],float[],float[],int,int[],int[],int[],java.lang.Integer,float[],int)
Dislin.confll( (float[])vec_transf.elementAt(0),
^
./Output.java:298: cannot resolve symbol
symbol : method format (java.lang.String,int)
location: class java.lang.String
Dislin.conlab("1.e+" + String.format("%02d", i + 7));
^
./Output.java:302: contri(float[],float[],float[],int,int[],int[],int[],int,float) in de.dislin.Dislin cannot be applied to (float[],float[],float[],int,int[],int[],int[],java.lang.Integer,float)
Dislin.contri( (float[])vec_transf.elementAt(0),
^
23 errors
-----------------


Danke im Vorraus.

Grüße
Sebastian
 
Soweit ich weis ist Autoboxing/-unboxing erst mit Javaversion 5 gekommen. Daher kannst du nicht einem int einen Integer zuweisen und umgekehrt.


Ebenfalls die format Methode der Klasse String ist erst in Java 5 hinzugekommen
 
genauso die anderen fehlenden Methoden zu neu (edit: wurde im Vorposting noch ergänzt 😉 ),
 
Soweit ich weis ist Autoboxing/-unboxing erst mit Javaversion 5 gekommen. Daher kannst du nicht einem int einen Integer zuweisen und umgekehrt.

Ok, dass ist mir auch so in Erinnerung. Gut, dass ich nochmal Bestätigung gefunden habe.

Wie lassen sich die anderen Fehler erklären, z.B. die String-Format Funktion, die sollte doch eigentlich jedes Java können ( - oder ist das auch Autoboxing, da es groß geschrieben ist? ).

Grüße

Sebastian
 
Vl hast du es noch nicht gelesen, da ich dies erst später hinzugefügt hatte.

Daher nein hat nichts mit boxing zu tun

Hallo,

danke euch nochmal für die Hinweise.

Wie siehst damit aus ?

Visual_Plane.java:143: cannot resolve symbol
symbol : method addAll (java.util.Vector,float[],float[])
location: class java.util.Collections
Collections.addAll(vector, xray, yray);
^
Visual_Plane.java:190: cannot resolve symbol
symbol : method addAll (java.util.Vector,int[],int[],int[],int)
location: class java.util.Collections
Collections.addAll(vector, i1ray, i2ray, i3ray, ntri);
^


Ist die Collections-Klasse ebenfalls ein neues Element der util-Programmbibliothek ? Wenn ja, wäre ich sehr überrascht. Vielleicht wisst ihr Rat.


Grüße

Sebastian
 

Zurück
Oben