Jump to content
  • Advertisement
Sign in to follow this  
ShadowSyntax

Building Error with KToolbar

This topic is 4452 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

http://www.gamedev.net/reference/programming/features/j2me1/page2.asp I've been following this tutorial, and up to page 3 I've been alright. But when I get up to the bit where I have to build a 'Basic MIDlet' I get given the error: javac: target release 1.1. conflicts with default source release 1.5 com.sun.kvem.ktools.ExecutionException Build failed I did a Google for that error and found a post on another forum where a guy encountered the exact same error and fixed it by downgrading his jdk (I'm not sure if I'm allowed to post links here). Do I have to downgrade my jdk to fix this problem or is there another way? Any help would be appreciated greatly.

Share this post


Link to post
Share on other sites
Advertisement
You don't have to downgrade your jdk. There is an option to force java to compile the code so that the target is 1.1.

When you compile the code from the command line you need to use the -source and -target flags to force the code to be compiled as 1.1. Have a look in the java docs to find out which one you need. I think you only need one of them.



Share this post


Link to post
Share on other sites
I have been building it with KToolbar up to this point in time.

How would I run it from a command prompt?

Also, what causes this sort of error?

Share this post


Link to post
Share on other sites
Dude, 1.1. is ancient. I understand J2ME hasn't caught up with the new stuff (and honestly it's not so useful for mobile programming anyway), but AFAIK 1.4.2 is considered pretty standard for this stuff...

Anyway, to package stuff from the command line, you would run 'javac' as usual, and then 'jar' and 'preverify' - check your docs for more info.

Share this post


Link to post
Share on other sites
The following link may be useful to explain it better.
http://java.sun.com/j2me/docs/alt-html/WTK104_UG/ch_cline.html#wp26484

Note – If you are using the compiler included with the Java 2 SDK, Standard Edition 1.4, use the -target 1.1 option when compiling your source files. If you do not do this, you will have problems preverifying your compiled classes.

I believe the problem is the specification for mobile phones is that they only need to support Java 1.1, this means that since the phones only support version 1.1 you can only create code that will run on 1.1. This is why you need to set the target to 1.1.

To use the command line for J2ME have a read of the KToolbar manual. I'm still not 100% sure why you are having the problem though since I can compile my files fine from KToolbar and I have Java 1.5 as my JDK.

Hopefully this is a bit clearer.

Greig

Share this post


Link to post
Share on other sites
I typed the following code into the command prompt:
javac -d tmpclasses -bootclasspath C:\WTK104\lib\midpapi.z
ip -classpath tmpclasses;classes src\*.java -target 1.1


And was given the error:
javac: target release 1.1 conflicts with default source release 1.5

Thats the same error KToolbar gives me :-P

[Edited by - ShadowSyntax on March 11, 2006 8:26:25 PM]

Share this post


Link to post
Share on other sites
Try adding -source 1.4 or -source 1.2 to the command line. This will make the compiler assume that the code is not using any Java 1.5 features.

Greig

Edit: I just noticed that you are running WTK1.04 (based on your directory name), there is a much newer version out 2.2. This probably won't fix your issue but just thought you might want to know.

Share this post


Link to post
Share on other sites
The newest version I can find is J2ME Wireless Toolkit 1.0.4_02 for Windows at http://java.sun.com/products/sjwtoolkit/download.html

EDIT: Nevermind, found it at a different link.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!