Zdravo! Od skoro sam poceo da ucim Java programiranje, sam bez nekog predznanja i nije mi islo lose do sada.... Ucim iz PDF-a koji je ok i dosta detaljan ali sam se kod jednog zadatka zaglavio.. Radim u JCreator-u i imam problem jer ne znam kako da importujem ConsoleReader klasu u program..To nije objasnjeno u knjizi.. Downloadovao sam ConsoleReader.java i ConsoleReader.class i kopirao u folder u kome radim program ali konstantno dobijam error..
Evo koda koji sam kucao u programu, prepisan iz PDF-a:
public class Menjacnica2
{ /*Ucitaj iznos u dinarima i preracunaj u eure*/
public static void main(String[] args)
{
ConsoleReader in = new ConsoleReader(System.in);
System.out.println("Unesi iznose eura i centi");
System.out.print("Iznos u eurima =");
int eura = in.readInt();
System.out.print("Iznos u centima =");
int centi = in.readInt();
centi = 100*eura + centi;
double dinara = centi * 0.0751;
System.out.print("Dinara: ");
System.out.print(dinara);
}
}
A evo i greske koju prijavljuje JCreator:
General output:
--------------------Configuration: <Default>--------------------
Error: Could not find or load main class Menjacnica2
Process completed.
Build Output:
--------------------Configuration: <Default>--------------------
C:\Users\Kanta\Documents\ProgramiranjeJava\Menjacnica2\Menjacnica2.java:6: error: cannot access ConsoleReader
ConsoleReader in = new ConsoleReader(System.in);
^
bad class file: C:\Users\Kanta\Documents\ProgramiranjeJava\Menjacnica2\ConsoleReader.class
class file contains wrong class: jline.ConsoleReader
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
Process completed.
Molim iskusne programere za pomoc!!
Hvala u svakom slucaju...Pozdrav..
Evo koda koji sam kucao u programu, prepisan iz PDF-a:
public class Menjacnica2
{ /*Ucitaj iznos u dinarima i preracunaj u eure*/
public static void main(String[] args)
{
ConsoleReader in = new ConsoleReader(System.in);
System.out.println("Unesi iznose eura i centi");
System.out.print("Iznos u eurima =");
int eura = in.readInt();
System.out.print("Iznos u centima =");
int centi = in.readInt();
centi = 100*eura + centi;
double dinara = centi * 0.0751;
System.out.print("Dinara: ");
System.out.print(dinara);
}
}
A evo i greske koju prijavljuje JCreator:
General output:
--------------------Configuration: <Default>--------------------
Error: Could not find or load main class Menjacnica2
Process completed.
Build Output:
--------------------Configuration: <Default>--------------------
C:\Users\Kanta\Documents\ProgramiranjeJava\Menjacnica2\Menjacnica2.java:6: error: cannot access ConsoleReader
ConsoleReader in = new ConsoleReader(System.in);
^
bad class file: C:\Users\Kanta\Documents\ProgramiranjeJava\Menjacnica2\ConsoleReader.class
class file contains wrong class: jline.ConsoleReader
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
Process completed.
Molim iskusne programere za pomoc!!
Hvala u svakom slucaju...Pozdrav..