Difference between revisions of "JavaAwt"

From Gumstix User Wiki
Jump to: navigation, search
(other isseus with classpath)
(Java on the stick)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Ecj problem, bulding classpath ==
+
=== issues with classpath ===
If you run into problems that your environment has an ecj that does not pass the checks in configure. You might want to try this:
+
To ensure that your Gentoo has the right version of the eclipse compiler
+
First you may have to unmerge the current eclipse-ecj
+
 
+
# emerge --unmerge eclipse-ecj
+
# cd /etc/portage
+
# echo ">=dev-java/eclipse-ecj-3.4" >> package.mask
+
# emerge eclipse-ecj --pretend
+
# emerge eclipse-ecj
+
 
+
Then,
+
# bitbake classpath -c clean
+
# bitbake classpath
+
 
+
==Building Classpath==
+
 
+
Building Classpath resulted in an error that was caused by a faulty classpath to the antlr.jar. The error may be a symptom of something else but --with_antlr_jar= addition to classpath_0.98.bb recipe got me past the issue:
+
EXTRA_OECONF += "\
+
                --disable-alsa \
+
                --disable-dssi \
+
                --disable-qt4-peer \
+
                --disable-plugin \
+
                --enable-gconf-peer \
+
                --enable-gtk-peer \
+
                --enable-local-sockets \
+
                --with-vm=java \
+
              --with_antlr_jar=~/overo-stable/tmp/staging/i686-linux/usr/share/java/antlr.jar \
+
              "
+
 
+
 
+
=== other isseus with classpath ===
+
  
 
Got a problem when building classpath: Invalid flag -1.5
 
Got a problem when building classpath: Invalid flag -1.5
Line 43: Line 12:
 
=== Java on the stick ===
 
=== Java on the stick ===
  
I still seem to miss some setting or packages to make it work.
+
I successfully built and executed JamVM and Classpath, see Creating boot image.
 +
However, running a small Java program that used AWT failed with the following exception trace:
  
 
  po@gumstix-custom-verdex:~/proto$ java ShowMe
 
  po@gumstix-custom-verdex:~/proto$ java ShowMe
Line 52: Line 22:
 
   at java.awt.Frame.<init>(Frame.java:246)
 
   at java.awt.Frame.<init>(Frame.java:246)
 
   at ShowMe.main(ShowMe.java:35)
 
   at ShowMe.main(ShowMe.java:35)
  Caused by: java.lang.UnsatisfiedLinkError: Native library `gtkpeer' not found (as file   `libgtkpeer.so') in gnu.classpath.boot.library.path and java.library.path
+
  Caused by: java.lang.UnsatisfiedLinkError: Native library `gtkpeer' not found (as file `libgtkpeer.so') in gnu.classpath.boot.library.path and java.library.path
 
   at java.lang.Runtime.loadLibrary(Runtime.java:763)
 
   at java.lang.Runtime.loadLibrary(Runtime.java:763)
 
   at java.lang.System.loadLibrary(System.java:662)
 
   at java.lang.System.loadLibrary(System.java:662)
Line 60: Line 30:
 
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:583)
 
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:583)
 
   ...4 more
 
   ...4 more
 +
 +
This was (once I understood the classpath recipe) easily fixed by making sure that my image recipe had lines for installing both classpath and classpath-awt, like so:
 +
 +
    classpath \
 +
    classpath-awt \
 +
 +
adding support for serial port using RXTX was done by adding the following lines:
 +
    librxtx-jni \
 +
    librxtx-java \

Latest revision as of 14:45, 8 July 2009

issues with classpath

Got a problem when building classpath: Invalid flag -1.5 Solution found here



a Know bug when building java. |here


Java on the stick

I successfully built and executed JamVM and Classpath, see Creating boot image. However, running a small Java program that used AWT failed with the following exception trace:

po@gumstix-custom-verdex:~/proto$ java ShowMe
java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
  at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:607)
  at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:103)
  at java.awt.Window.<init>(Window.java:133)
  at java.awt.Frame.<init>(Frame.java:246)
  at ShowMe.main(ShowMe.java:35)
Caused by: java.lang.UnsatisfiedLinkError: Native library `gtkpeer' not found (as file `libgtkpeer.so') in gnu.classpath.boot.library.path and java.library.path
  at java.lang.Runtime.loadLibrary(Runtime.java:763)
  at java.lang.System.loadLibrary(System.java:662)
  at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(GtkToolkit.java:173)
  at java.lang.VMClass.forName(Native Method)
  at java.lang.Class.forName(Class.java:233)
  at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:583)
  ...4 more

This was (once I understood the classpath recipe) easily fixed by making sure that my image recipe had lines for installing both classpath and classpath-awt, like so:

   classpath \
   classpath-awt \

adding support for serial port using RXTX was done by adding the following lines:

   librxtx-jni \
   librxtx-java \