Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Exception in thread "main" java.lang.NoClassDefFoundError

Hi,

I have troubles starting a software called "Comsol" remotely from my Mac-Intel.

This software is installed on a computer (under linux) called "Erable" and when I try to run it from my MacBook ("Europa") using ssh, I get the following error message :

europa$ ssh -X erable
erable[1] comsol
Exception in thread "main" java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.ja va:62)
at java.awt.Font.initializeFont(Font.java:308)
at java.awt.Font.<init>(Font.java:344)
at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme .java:195)
at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:153)
at javax.swing.plaf.metal.DefaultMetalTheme.getMenuTextFont(DefaultMetalTheme.java :141)
at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAn dFeel.java:1408)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:199)
at javax.swing.UIDefaults.get(UIDefaults.java:129)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getFont(UIDefaults.java:349)
at javax.swing.UIManager.getFont(UIManager.java:491)
at com.femlab.controls.FlControlUtil.setLookAndFeel(SourceFile:133)
at com.femlab.controls.FlControlUtil.setLookAndFeel(SourceFile:74)
at com.femlab.gui.Femlab.initNoMph(SourceFile:79)
at com.femlab.gui.Femlab.init(SourceFile:63)
at com.femlab.gui.Femlab.launch(SourceFile:1305)
at com.femlab.gui.Femlab.main(SourceFile:1287)


NB : ssh version OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006

Since, running Comsol remotely on this computer works well from other computers but not from my MacBook, I think Mac OS X has something to do with it ...

Any clue on how to fix this problem ?

Thanks in advance.

MacBook Pro Mac OS X (10.4.9)

Posted on Mar 14, 2007 6:33 AM

Reply
7 replies

Mar 14, 2007 8:18 AM in response to Anne-Sophie Mouronval

The error message is most likely being caused by the java application not being able to determine what windowing environment you are running. You are running this application on a remote host using SSH, but it is a graphical (
Swing/AWT) application. In order for this to work, you will need to forward X11 via SSH; this is the most likely cause of your problem.

A couple of things to note: first, you will need to install X11 on your Mac if you have not done so already. Second, you will need to make sure that you are forwarding X11 traffic from the remote host to your display (on your mac). What is the exact ssh command that you are running from your mac? (without the host name, obviously)

Keep in mind that when running SSH and executing an application, the application is running *on the remote computer*, not on your local machine. Forwarding X11 means that, while the application is running on the remote host, the display is on your local machine.

This error is a bug in the application that you are running; it cannot determine what kind of display you are running, and it does not handle this case graciously.





Why reward points?(Quoted from Discussions Terms of Use.)
The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

Mar 14, 2007 8:45 AM in response to Steven Davidson

Thanks for your help.

X11 is already installed on my Mac.

First, I used the "terminal window" that can be found in "Applications"/Utilities" ant typed "ssh -X" to access to the remote host.
I thought that using the -X option was enought to forward the X11 traffic from the remote host to my local display but I got the java error I wrote in my previous message.

Now, if I open a "X Window" (X11 1.1 - Xfree86 4.4.0) or a XDarwin Window (1.4.a1) instead of a "classical terminal" and if I use "ssh -X" to access to the remote host, I have no java error after running the software. However I get a new windows that should be the graphical interface of the software but it's empty (the title of this new window is right but it contents nothing).

I checked the DISPLAY variable on the remote host : it is set to my local display.

Mar 14, 2007 10:54 AM in response to Anne-Sophie Mouronval

it may help to see if the problem is application-specific, or affects all java swing applications.

Try this. On the host, execute the following:
wget http://downloads.sourceforge.net/hirudo/hirudo-0.7.jar

or, if you don't have wget:
curl http://downloads.sourceforge.net/hirudo/hirudo-0.7.jar

then run:
java -jar hirudo-0.7.jar

(this was the first swing app that I found while googling - it's pretty simple, but should let us know whether or not there is a problem with swing apps in general.)

If is application runs, then you should contact the application vendor. If not, we can look at some other stuff.

Mar 15, 2007 3:27 AM in response to Anne-Sophie Mouronval

Thanks.

I've just learned from the application vendor that using
this software over SSH is forbidden by the licence agreement. So I should
stop trying to do this and run the software as a client/server application.

However, I'll have a look at hirudo 🙂 ...

Thanks again for your help.

MacBook Pro Mac OS X (10.4.9)

Mar 15, 2007 11:57 AM in response to Anne-Sophie Mouronval

Thanks.

I've just learned from the application vendor that
using
this software over SSH is forbidden by the licence
agreement.


That's odd. You would think that they wouldn't care, as it is still running on the licensed host. Strange.

You could always look at VNC - it can be faster than X forwarding.

However, I'll have a look at hirudo 🙂 ...


<g> I pulled that one out of the ether - not even sure what it does. It was a convenient jar file.

Exception in thread "main" java.lang.NoClassDefFoundError

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.