Προς το περιεχόμενο

java question


dominant

Προτεινόμενες αναρτήσεις

Δημοσ.

Εστω εχεις μερικα αρχεια (class, jpg, txt , anything) sto idio folder,

και το προγραμμα πρεπει να ξεκινησει απο το hello.class οπου εχεις την

main.

 

φτιαχνεις ενα αρχειο οπου βαζεις μια και μονο γραμμη

>Main-Class: hello

εστω hellomanifest.txt

 

εκτελεις

 

>jar cmf hellomanifest.txt helloapp.jar hello.class

στη θεση του hello.class βαζεις 1-1 ολα τα αρχεια, ή wildcards *.class, *, κλπ

 

http://java.sun.com/docs/books/tutorial/jar/index.html

και οπου εχεις το jdk... /docs/tooldocs/windows/jar.html

Δημοσ.

prospaisa na trekso to jar pou parax8ike se Siemens emulator kai elava auto to la8os

>
Error verifying method Hello commandAction(Ljavax/microedition/lcdui/Command;Lja
vax/microedition/lcdui/Displayable;)V
Approximate bytecode offset 8: Inconsistent or missing stackmap at target

 

Kserei kaneis ti simenei auto?

Δημοσ.

αν δεν το κανεις executable, pali to idio γινεται?

----

μπορει να ειναι και bug του emulator. δοκιμασε αλλον, ή ενα πραγματικο τηλεφωνο :)

---

αν βαλεις τις λεξεις του error στο google βρισκεις.

 

πχ (δεν ξερω αν ειναι σχετικο): να κανεις preverify πριν απο jar

 

When debugging my code, it suddenly errors with:

Error verifying method ppPersonal commandAction(Ljavax/microedition/lcdui/Command;Ljavax/microedition/lcdui/Displayable;)V

Approximate bytecode offset 5: Inconsistent or missing stackmap at target

ALERT: Error verifying class ppPersonal

 

Even though everything worked nicely just a short while ago.

Ok, I admit having tampered with choosing different java compilers trying to get rid of the String.substring bug, but after restoring all my config changes i still get this message.

------------------------------------------------------------------

Found the problem...

Changed the Java compiler back to "Preverify Compiler" in the

Tools -> Options -> -> java Sources ->properties

Im still a bit curious how to be able to use the other compilers

without getting this error though...

------------------------------------------------------------------

Author: kishor_ahuja

I would like to explain the problem properly.

If the code is compiled with "javac" and tried to move to

the device(or emulator)it may give the error "Error Verifying method"

so following stpes should be done.

 

1. compile with javac (see the proper version)

2.run preverify on the class files.

eg. preverify.exe MyCanvas (do not put ".class" )

 

3. a folder called output should be created having "previewd"

.class files, use these filess to create ".jar"

Δημοσ.

etreksa

 

>
C:\>javac hello.java

C:\>preverify hello
Error preverifying class hello
   Class loading error: Wrong name

 

Mesa sto hello.java den yparxei public static void main(.....) {}

 

Den yparxei se kanena paradeigmataki paixnidaki pou exei o emulator.

 

Ti ginete edo?

Δημοσ.

Prwta ap' ola, an 8eleis na dior8wseis ena post sou h na pros8eseis kati se afto, xrhsimopoihse to koumpaki edit...

 

Oson afora to J2ME toolkit, mporeis na diavaseis ola afta pou xreiazesai sto J2ME Wireless Toolkit User's Guide.

 

H diadikasia einai poly aplh. Dhmiourgeis ena project me to toolkit, kai mesa ston src katalogo pou dhmiourgeitai, vazeis olo ton kwdika pou exeis grapsei. Meta apla patas compile kai ola einai etoima ;) Gia perissoteres leptomereies des edw

 

D.

Δημοσ.

Ap oso vlepw apo th lista me ta kinhta ths Sun to S55 exei MIDP 1.0. Einai poly pi8ano pws to compile pou kaneis me to toolkit einai gia MIDP 2.0. Sta settings mporeis na epile3eis sthn kartela "API Selection" to MIDP gia to opoio kaneis compile. To JTWI einai MIDP 2.0, enw yparxei kai to profile MIDP 1.0 pou xreiazesai.

 

An exeis xrhsimopoihsei mono API tou MIDP 1.0 de 8a exeis kanena provlhma me to compile. An de doulevei kai tote, tote lypamai alla ftaiei h Siemens kai oxi h Sun...

 

D.

Δημοσ.

ekana oti mou eipes.

 

Eriksa sto c:\wtk22\apps\Hello\src\ to Hello.java kai epeleksa sto project to API Selection na einai midp 0.1 alla distyxos den paizei sto siemens auto.

 

Periergo auto den einai? Upoti8ete oti oi efarmoges java einai portable. :(

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...