From midi at liab.dk Thu Oct 27 03:44:21 2011 From: midi at liab.dk (Mikael Dich) Date: Thu, 27 Oct 2011 11:44:21 +0200 Subject: [dev65] A little help on TC65 development on Linux... Message-ID: <4EA927F5.8090306@liab.dk> Dear TC65 Mailing list! Being a Linux guy, I want to be able to compile java programs for the Cinterion TC65 and TC65i modems under Linux. Using jdk1.7.0 and WTK2.5.2, combined with the classes.zip (and examples) file from Cinetion development suite I have succesfully compiled some java program for the TC65 modem. These programs are transferred to the TC65 using the patched obexftp as described on the webpage:http://www.xargs.com/linux/tc65-linux.html. Next, they are started using at^sjra=a:/midijava/HelloWold.jad or similar... As long as I stick to classes and methods from java.* and javax.* my programs funtions nicely on the TC65. This goes for methods like System.out.println(...) and commConn.openOutputStream(), i.e. I can do the examples like HelloWorld.java and RS232Demo.java in the Cinterion examples suite. Now, if I include something like: private ATCommand ATCmd = null; ... public HelloWorld() { try { ATCmd = new ATCommand(false); } catch (ATCommandFailedException e) { ... } in my java program, the program still compiles nicely, but when I try to start it on the TC65 platform, I get: 1) JAVA ERROR: MIDlet initialization failed: java.lang.NoClassDefFoundError: com/cinterion/io/ATCommandFailedException I now try to include all of com/cinterion/io/AT* in my jar-file When I now start my program I get: 2) JAVA ERROR: MIDlet initialization failed: java.lang.Error: UnsatisfiedLinkError: openATCommand I have tried to compile the FwUpDemo-program on a Windows computer with a Cinterion installation. After transferring the jar/jad files to the platform using obexftp I get something similar to 1). Does anybody have a clue to what I do wrong? With the hope that somebody out there is smarter than me! Regards :-) Mikael Dich, LIAB ApS ------------------------------------------ Compile commands: /usr/lib/jvm/jdk1.7.0/bin/javac -source 1.4 -target 1.4 -O -bootclasspath \ ./lib/classes.zip -d ./tmpclasses src/HelloWorld.java /usr/lib/jvm/WTK2.5.2/bin/preverify -target CLDC1.0 -classpath \ ./lib/classes.zip -d ./classes ./tmpclasses /usr/lib/jvm/jdk1.7.0/bin/jar cfm ./bin/HelloWorld.jar \ ./bin/HelloWorld.jad.base -C ./classes HelloWorld For the preverifier, I have tried several combinations of -nofinalize, -nonative and CLDC1.[01] From ivanfm.listas at gmail.com Thu Oct 27 05:20:00 2011 From: ivanfm.listas at gmail.com (Ivan Martinez) Date: Thu, 27 Oct 2011 09:20:00 -0200 Subject: [dev65] A little help on TC65 development on Linux... In-Reply-To: <4EA927F5.8090306@liab.dk> References: <4EA927F5.8090306@liab.dk> Message-ID: Try using the siemens classes : com.siemens.icm.io.ATCommand com.siemens.icm.io.ATCommandFailedException On Thu, Oct 27, 2011 at 07:44, Mikael Dich wrote: > Dear TC65 Mailing list! > > Being a Linux guy, I want to be able to compile java programs for the > Cinterion TC65 and TC65i modems under Linux. > > Using jdk1.7.0 and WTK2.5.2, combined with the classes.zip (and > examples) file from Cinetion development suite I have succesfully > compiled some java program for the TC65 modem. These programs are > transferred to the TC65 using the patched obexftp as described on the > webpage:http://www.xargs.com/linux/tc65-linux.html. Next, they are > started using at^sjra=a:/midijava/HelloWold.jad or similar... > > As long as I stick to classes and methods from java.* and javax.* my > programs funtions nicely on the TC65. This goes for methods like > System.out.println(...) and commConn.openOutputStream(), i.e. I can do > the examples like HelloWorld.java and RS232Demo.java in the Cinterion > examples suite. > > Now, if I include something like: > > ? ? ? ? ?private ATCommand ?ATCmd = null; > ? ? ? ? ?... > ? ? ? ? ?public HelloWorld() > ? ? ? ? ?{ > ? ? ? ? ? ? try > ? ? ? ? ? ? { > ? ? ? ? ? ? ? ? ATCmd = new ATCommand(false); > ? ? ? ? ? ? } > ? ? ? ? ? ? catch (ATCommandFailedException e) > ? ? ? ? ? ? { > ? ? ? ? ? ? ? ? ... > ? ? ? ? ? ? } > > in my java program, the program still compiles nicely, but when I try > to start it on the TC65 platform, I get: > > 1) JAVA ERROR: MIDlet initialization failed: > java.lang.NoClassDefFoundError: com/cinterion/io/ATCommandFailedException > > I now try to include all of com/cinterion/io/AT* in my jar-file > > When I now start my program I get: > > 2) JAVA ERROR: MIDlet initialization failed: > java.lang.Error: UnsatisfiedLinkError: openATCommand > > I have tried to compile the FwUpDemo-program on a Windows computer > with a Cinterion installation. After transferring the jar/jad files to > the platform using obexftp I get something similar to 1). > > Does anybody have a clue to what I do wrong? > > With the hope that somebody out there is smarter than me! > > Regards > :-) ?Mikael Dich, LIAB ApS > > ------------------------------------------ > > Compile commands: > > /usr/lib/jvm/jdk1.7.0/bin/javac -source 1.4 -target 1.4 -O -bootclasspath > \ > ./lib/classes.zip -d ./tmpclasses src/HelloWorld.java > /usr/lib/jvm/WTK2.5.2/bin/preverify -target CLDC1.0 -classpath \ > ./lib/classes.zip -d ./classes ./tmpclasses > /usr/lib/jvm/jdk1.7.0/bin/jar cfm ./bin/HelloWorld.jar \ > ./bin/HelloWorld.jad.base -C ./classes HelloWorld > > For the preverifier, I have tried several combinations of -nofinalize, > -nonative and CLDC1.[01] > > > > _______________________________________________ > dev65 mailing list > dev65 at castrov.cuug.ab.ca > From midi at liab.dk Thu Oct 27 07:23:11 2011 From: midi at liab.dk (Mikael Dich) Date: Thu, 27 Oct 2011 15:23:11 +0200 Subject: [dev65] A little help on TC65 development on Linux... In-Reply-To: References: <4EA927F5.8090306@liab.dk> Message-ID: <4EA95B3F.3090200@liab.dk> Thank you for your response Ivan! In my java file had in the first place import com.cinterion.io.*; and I have tried to be more selective by specifying: import com.cinterion.io.ATCommand; import com.cinterion.io.ATCommandFailedException; This doesn't make any diffence... When producing the jar file I have tried to resolve the NoClassDefFoundError one at at time and when I have the following jar-file: midi at hvede$ jar tvf bin/HelloWorld.jar 0 Thu Oct 27 15:03:46 CEST 2011 META-INF/ 318 Thu Oct 27 15:03:46 CEST 2011 META-INF/MANIFEST.MF 0 Tue Oct 25 20:15:14 CEST 2011 HelloWorld/ 1473 Thu Oct 27 14:53:08 CEST 2011 HelloWorld/HelloWorld.class 0 Thu Oct 27 14:52:32 CEST 2011 com/ 0 Thu Oct 27 14:52:38 CEST 2011 com/cinterion/ 0 Thu Oct 27 15:03:42 CEST 2011 com/cinterion/io/ 225 Thu Oct 27 15:01:40 CEST 2011 com/cinterion/io/ATCommandFailedException.class 1190 Thu Oct 27 15:02:06 CEST 2011 com/cinterion/io/ATCommand$OutputStreamDataConnection.class 1378 Thu Oct 27 15:03:42 CEST 2011 com/cinterion/io/ATCommand$InputStreamDataConnection.class 8223 Thu Oct 27 15:01:26 CEST 2011 com/cinterion/io/ATCommand.class the error changes from java.lang.NoClassDefFoundError to: JAVA ERROR: MIDlet initialization failed: java.lang.Error: UnsatisfiedLinkError: openATCommand For me it seemes that the runtime linking in the JVM in the modem fails due to lack of some (native) methods... I have tried to grep for openATCommand i all classes of classes.zip, but it is only found in com/cinterion/io/ATcommand.class... (at least in clear text) - is there something similar to objdump for java classes? Regards :-) Mikael Dich On 2011-10-27 13:20, Ivan Martinez wrote: > Try using the siemens classes : > > com.siemens.icm.io.ATCommand > com.siemens.icm.io.ATCommandFailedException > > > On Thu, Oct 27, 2011 at 07:44, Mikael Dich wrote: >> Dear TC65 Mailing list! >> >> Being a Linux guy, I want to be able to compile java programs for the >> Cinterion TC65 and TC65i modems under Linux. >> >> Using jdk1.7.0 and WTK2.5.2, combined with the classes.zip (and >> examples) file from Cinetion development suite I have succesfully >> compiled some java program for the TC65 modem. These programs are >> transferred to the TC65 using the patched obexftp as described on the >> webpage:http://www.xargs.com/linux/tc65-linux.html. Next, they are >> started using at^sjra=a:/midijava/HelloWold.jad or similar... >> >> As long as I stick to classes and methods from java.* and javax.* my >> programs funtions nicely on the TC65. This goes for methods like >> System.out.println(...) and commConn.openOutputStream(), i.e. I can do >> the examples like HelloWorld.java and RS232Demo.java in the Cinterion >> examples suite. >> >> Now, if I include something like: >> >> private ATCommand ATCmd = null; >> ... >> public HelloWorld() >> { >> try >> { >> ATCmd = new ATCommand(false); >> } >> catch (ATCommandFailedException e) >> { >> ... >> } >> >> in my java program, the program still compiles nicely, but when I try >> to start it on the TC65 platform, I get: >> >> 1) JAVA ERROR: MIDlet initialization failed: >> java.lang.NoClassDefFoundError: com/cinterion/io/ATCommandFailedException >> >> I now try to include all of com/cinterion/io/AT* in my jar-file >> >> When I now start my program I get: >> >> 2) JAVA ERROR: MIDlet initialization failed: >> java.lang.Error: UnsatisfiedLinkError: openATCommand >> >> I have tried to compile the FwUpDemo-program on a Windows computer >> with a Cinterion installation. After transferring the jar/jad files to >> the platform using obexftp I get something similar to 1). >> >> Does anybody have a clue to what I do wrong? >> >> With the hope that somebody out there is smarter than me! >> >> Regards >> :-) Mikael Dich, LIAB ApS >> >> ------------------------------------------ >> >> Compile commands: >> >> /usr/lib/jvm/jdk1.7.0/bin/javac -source 1.4 -target 1.4 -O -bootclasspath >> \ >> ./lib/classes.zip -d ./tmpclasses src/HelloWorld.java >> /usr/lib/jvm/WTK2.5.2/bin/preverify -target CLDC1.0 -classpath \ >> ./lib/classes.zip -d ./classes ./tmpclasses >> /usr/lib/jvm/jdk1.7.0/bin/jar cfm ./bin/HelloWorld.jar \ >> ./bin/HelloWorld.jad.base -C ./classes HelloWorld >> >> For the preverifier, I have tried several combinations of -nofinalize, >> -nonative and CLDC1.[01] >> >> >> >> _______________________________________________ >> dev65 mailing list >> dev65 at castrov.cuug.ab.ca >>