jpatch + kubuntu linux

User support for JPatch

jpatch + kubuntu linux

Postby Eric » Wed Feb 08, 2006 5:22 pm

I have downloaded jpatch 0.4 Preview 1 and trying to run it as specified on jpatch website I got :

Code: Select all
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
   at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/libgcj.so.6.0.0)
   at java.awt.Font.tk() (/usr/lib/libgcj.so.6.0.0)
   at java.awt.Font.getPeerFromToolkit(java.lang.String, java.util.Map) (/usr/lib/libgcj.so.6.0.0)
   at java.awt.Font.Font(java.lang.String, int, int) (/usr/lib/libgcj.so.6.0.0)
   at javax.swing.plaf.FontUIResource.FontUIResource(java.lang.String, int, int) (/usr/lib/libgcj.so.6.0.0)
   at javax.swing.plaf.metal.DefaultMetalTheme.<clinit>() (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
   at javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme() (/usr/lib/libgcj.so.6.0.0)
   at javax.swing.plaf.metal.MetalLookAndFeel.MetalLookAndFeel() (/usr/lib/libgcj.so.6.0.0)
   at javax.swing.UIManager.<clinit>() (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
   at jpatch.boundary.JPatchSettings.JPatchSettings() (Unknown Source)
   at jpatch.boundary.JPatchSettings.getInstance() (Unknown Source)
   at jpatch.Launcher.main(java.lang.String[]) (Unknown Source)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: gnu.java.awt.peer.gtk.GtkToolkit not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:jpatch.jar,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/libgcj.so.6.0.0)
   ...15 more


Afaik Java is installed on my system.
My system is a kubuntu linux 5.10 (Breezy) with a 2.6.12-10.k7-smp kernel.

Any suggestion welcome.
Eric
 

Postby sascha » Wed Feb 08, 2006 6:01 pm

The latest Ubuntu (5.10) distribution (and I assume Kubuntu as well) came with GCJ - the Gnu Java compiler and runtime.
While this is certainly cool (because it's a really free and open-source Java environment), it is still not 100% compatible with Sun's JRE, and IIRC support for Java 1.5 is still pretty poor.

To run JPatch, I recommend (at this time) downloading and installing the latest JRE from Sun Microsystems - a linux version is available.

I'm running Ubuntu and have multimple JREs installed - I have them all in /opt, with a symlink "java" pointing to the one I'm currently using - and /opt/java/bin in my path...
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby squirrelhavoc » Thu Feb 09, 2006 12:52 am

I just reinstalled Ubuntu, and the JDK5 from Sun, and when I went to fire up Jpatch, I get this error:

Exception in thread "main" java.lang.VerifyError: verification failed at PC 96 in jpatch.Launcher:main(([Ljava.lang.String;)V): String, int, or float constant expected
at ._ZN4java4lang11VMThrowable16fillInStackTraceEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9Throwable16fillInStackTraceEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5ErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang12LinkageErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang11VerifyErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN20_Jv_BytecodeVerifier11verify_failEPci (/usr/lib/libgcj.so.6.0.0)
at ._ZN20_Jv_BytecodeVerifier21verify_instructions_0Ev (/usr/lib/libgcj.so.6.0.0)
at ._Z16_Jv_VerifyMethodP16_Jv_InterpMethod (/usr/lib/libgcj.so.6.0.0)
at ._ZN21_Jv_InterpreterEngine9do_verifyEPN4java4lang5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN10_Jv_Linker12verify_classEPN4java4lang5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN10_Jv_Linker14wait_for_stateEPN4java4lang5ClassEi (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang13VMClassLoader12resolveClassEPNS0_5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class15initializeClassEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class7forNameEPNS0_6StringEbPNS0_11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN3gnu4java4lang10MainThread3runEv (/usr/lib/libgcj.so.6.0.0)
at ._Z13_Jv_ThreadRunPN4java4lang6ThreadE (/usr/lib/libgcj.so.6.0.0)
at ._Z11_Jv_RunMainP14_Jv_VMInitArgsPN4java4lang5ClassEPKciPS6_b (/usr/lib/libgcj.so.6.0.0)
at .main (/usr/lib/libgij.so.6.0.0)
at .__libc_start_main (/lib/tls/i686/cmov/libc-2.3.5.so)


Did I setup the runtime wrong or something?

EDIT: All I did to setup the runtime was add the java path to the PATH variable, and setup JAVA_HOME variable. If I remember right, I have to do more, but it's been a while for me, and I can't seem to remember if I did it right
Squirrel Havoc

We live as we think, very very slowly....
squirrelhavoc
 
Posts: 180
Joined: Tue Jun 28, 2005 11:17 pm
Location: Oklahoma, USA

Postby sascha » Thu Feb 09, 2006 9:17 am

/usr/lib/libgcj.so.6.0.0

looks like gcj...

If you don't need the Gnu Java compiler, I'd recommend uninstalling it (using Synaptic). On the commandline, "which java" will tell you the full path to your java executable, and "java -version" the version. It should be something like
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)


EDIT: AFAIK GCJ has a "java" symlink in /bin or /usr/bin - this probably has precedence in your PATH over your Java installation. If you don't need it, you can delete or rename that symlink.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria


Return to Support / Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron