Thread Subject: java problems in Ubuntu

Subject: java problems in Ubuntu

From: Nathanael Greene

Date: 3 Oct, 2007 18:14:59

Message: 1 of 8

I'm running Matlab R2007a in Ubuntu Feisty with Beryl, and I
have several problems. Firstly, I can't get matlab to run
unless I run it as an application in a terminal. Otherwise
I receive the error:
 Failed to start the Desktop: Failure loading desktop class

I also get this error when I start Matlab:
Exception in thread "Thread-7" java.lang.NoClassDefFoundError
at com.mathworks.mde.editor.IDEEditor.<init>(IDEEditor.java:94)
at
com.mathworks.mde.editor.IDEEditor.getInstance(IDEEditor.java:66)
at
com.mathworks.mde.editor.EditorServices.loadBuiltinEditor(EditorServices.java:499)
at
com.mathworks.mde.editor.EditorServices.loadEEIEditor(EditorServices.java:530)
at
com.mathworks.mde.editor.EditorViewContainer.<clinit>(EditorViewContainer.java:165)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
com.mathworks.mde.desk.StartupClassLoader.callClassForName(StartupClassLoader.java:304)
at
com.mathworks.mde.desk.StartupClassLoader.loadClass(StartupClassLoader.java:282)
at
com.mathworks.mde.desk.StartupClassLoader.access$900(StartupClassLoader.java:27)
at
com.mathworks.mde.desk.StartupClassLoader$LoadThread.run(StartupClassLoader.java:271)

I also get this error when trying to run the editor:
??? Error using ==> edit>handleError at 462
Failed to open editor. Load of Java classes failed.

Finally, I am unable to see toolbars above the command
window when running Matlab with Beryl.

Subject: java problems in Ubuntu

From: vladimir

Date: 6 Oct, 2007 00:08:43

Message: 2 of 8

"Nathanael Greene" <nate.greene@gmail.com> wrote in message
<fe0m73$q2h$1@fred.mathworks.com>...
> I'm running Matlab R2007a in Ubuntu Feisty with Beryl, and I
> have several problems. Firstly, I can't get matlab to run
> unless I run it as an application in a terminal. Otherwise
> I receive the error:
> Failed to start the Desktop: Failure loading desktop class

I have had a similiar problem with Suse 10.2 with R2007a. I
replaced the jre at
{matlabroot}/sys/java/jre/glnxa64/jre1.5.0 with the current
 jre from www.java.com/en/download/manual.jsp, which for me
was jre-6u3-linux-amd64.bin. After installing the new jre I
updated the jre.cfg file with the jre version number and
matlab started up from the command line.

To get it to start from my KDE menu I entered
   matlab -desktop
 as the command in the KDE Menu Editor which allows it to be
started from a mouse click.

>
> I also get this error when I start Matlab:
> Exception in thread "Thread-7" java.lang.NoClassDefFoundError
> at
com.mathworks.mde.editor.IDEEditor.<init>(IDEEditor.java:94)
> at
>
com.mathworks.mde.editor.IDEEditor.getInstance(IDEEditor.java:66)
> at
>
com.mathworks.mde.editor.EditorServices.loadBuiltinEditor(EditorServices.java:499)
> at
>
com.mathworks.mde.editor.EditorServices.loadEEIEditor(EditorServices.java:530)
> at
>
com.mathworks.mde.editor.EditorViewContainer.<clinit>(EditorViewContainer.java:165)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at
>
com.mathworks.mde.desk.StartupClassLoader.callClassForName(StartupClassLoader.java:304)
> at
>
com.mathworks.mde.desk.StartupClassLoader.loadClass(StartupClassLoader.java:282)
> at
>
com.mathworks.mde.desk.StartupClassLoader.access$900(StartupClassLoader.java:27)
> at
>
com.mathworks.mde.desk.StartupClassLoader$LoadThread.run(StartupClassLoader.java:271)
>
> I also get this error when trying to run the editor:
> ??? Error using ==> edit>handleError at 462
> Failed to open editor. Load of Java classes failed.
>
> Finally, I am unable to see toolbars above the command
> window when running Matlab with Beryl.

Subject: java problems in Ubuntu

From: Nathanael Greene

Date: 6 Oct, 2007 17:20:28

Message: 3 of 8

I just upgraded to R2007b, and while I can now start the
application outside of a terminal (which is great), I can no
longer see anything, not even the command window, in the
Matlab window when used in conjunction with Beryl. Use of:
"export AWT_TOOLKIT=MToolkit" in the Matlab script causes
the program to crash. 2007b contains the most recent JRE
version, so I can't even point it to the newer version. Any
ideas would be greatly appreciated. I'm continuing to use
it by turning off Beryl before, but I'd like to be able to
use it with my computer as-is. Thanks,
Nate

Subject: java problems in Ubuntu

From: Timothy

Date: 9 Oct, 2007 18:48:32

Message: 4 of 8

"Nathanael Greene" <nate.greene@gmail.com> wrote in message
<fe8g4s$aig$1@fred.mathworks.com>...
> I just upgraded to R2007b, and while I can now start the
> application outside of a terminal (which is great), I can no
> longer see anything, not even the command window, in the
> Matlab window when used in conjunction with Beryl. Use of:
> "export AWT_TOOLKIT=MToolkit" in the Matlab script causes
> the program to crash. 2007b contains the most recent JRE
> version, so I can't even point it to the newer version. Any
> ideas would be greatly appreciated. I'm continuing to use
> it by turning off Beryl before, but I'd like to be able to
> use it with my computer as-is. Thanks,
> Nate

I finally got 2007a to work with toolbars inside Beryl using
"AWT_TOOLKIT=MToolkit" on my AMD64 machine (kernel
2.6.18-5-amd64). The trick was to create a symbolic link:

[matlabroot]/sys/java/jre/glnxa64/jre1.5.0/lib/amd64/motif12

to the motif21 directory. Before making this link I was
getting the following error: "Failed to start the Desktop:
Failure loading desktop class" with AWT_TOOLKIT set to
MToolkit. Not sure if this will help in your case, but it
might. Cheers, Tim

Subject: java problems in Ubuntu

From: Nathanael Greene

Date: 10 Oct, 2007 03:54:31

Message: 5 of 8

First of all, thanks for the response. I tried that
suggestion and received a Segmentation Fault when I tried to
start Matlab. Just to make sure I didn't do anything silly,
I tried this two different ways. I created the symbolic
link using:
ln -s
[matlabroot]/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/motif21
[matlabroot]/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/motif12

I then edited the Matlab script file and added:
export AWT_TOOLKIT=MToolkit

When that produced the Seg Fault I removed it and tried
running Matlab instead with:
export AWT_TOOLKIT=MToolkit; matlab -desktop

This produced the same error. Minus the AWT_TOOLKIT fix
(with the symbolic link still in place) I still get a blank
area for the entire MATLAB window (except for the Start
button in the bottom left, which miraculously works
perfectly). Any other ideas?

Subject: java problems in Ubuntu

From: Timothy

Date: 10 Oct, 2007 12:34:20

Message: 6 of 8

"Nathanael Greene" <nate.greene@gmail.com> wrote in message
<fehidn$n8f$1@fred.mathworks.com>...
> First of all, thanks for the response. I tried that
> suggestion and received a Segmentation Fault when I tried to
> start Matlab. Just to make sure I didn't do anything silly,
> I tried this two different ways. I created the symbolic
> link using:
> ln -s
> [matlabroot]/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/motif21
> [matlabroot]/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/motif12
>
> I then edited the Matlab script file and added:
> export AWT_TOOLKIT=MToolkit
>
> When that produced the Seg Fault I removed it and tried
> running Matlab instead with:
> export AWT_TOOLKIT=MToolkit; matlab -desktop
>
> This produced the same error. Minus the AWT_TOOLKIT fix
> (with the symbolic link still in place) I still get a blank
> area for the entire MATLAB window (except for the Start
> button in the bottom left, which miraculously works
> perfectly). Any other ideas?

Well, I was getting seg faults as well until I switched back
to the jre that shipped with my version of Matlab (2007a),
which is 1.5. Are you using the Java version that shipped
with your version? Is that 1.6? I was getting seg faults
with 1.6. You may want to try using a different jre. I would
try the one that ships with Ubuntu, or maybe you can
download a different version from the Sun website. This may
break other things with 2006b, but I'm not sure. It's worth
a try.

Also, if you do try another version of Java, you will need
to make sure that you create the symbolic link discussed
earlier in the other Java directory, and tell Matlab to use
the different version. I think you have the symlink correct.
There needs to be a symlink called motif12 that points to
the real directory motif21. Also, are you using the amd64
version of Matlab? Cheers, Tim

Subject: java problems in Ubuntu

From: Timothy

Date: 29 May, 2008 22:42:02

Message: 7 of 8

Just to follow up on this, in case anyone out there is
interested, I am now using Compiz version
0.6.3~git20080115.0ea58487-1 on Debian Lenny with kernel
2.6.24-1-amd64, and I am running Matlab 2008a. I have found
that the latest snapshot of the JRE is working relatively
well with Matlab, which you can find at
http://download.java.net/jdk6/binaries/. I instruct Matlab
to use this JRE by adding this line

export MATLAB_JAVA=/usr/lib/jvm/jdk1.6.0_10/jre/

to the Matlab startup script which for me is located at
/usr/local/matlab76/bin/matlab (your Matlab root may differ,
and the location of your JRE may differ). One key
requirement is that you create the symbolic link from
motif21 to motif12 in the amd64 directory which for me is
located in /usr/lib/jvm/jdk1.6.0_10/jre/lib/amd64 (again
your location may differ). I have found that the old
workaround "export AWT_TOOLKIT=MToolkit" cannot be set for
any of this to work. Also know that the motif12 link is a
total kluge that I don't understand, so proceed at your own
risk. Good luck!

Cheers,
Tim

Subject: java problems in Ubuntu

From: Timothy

Date: 29 May, 2008 22:44:02

Message: 8 of 8

Just to follow up on this, in case anyone out there is
interested, I am now using Compiz version
0.6.3~git20080115.0ea58487-1 on Debian Lenny with kernel
2.6.24-1-amd64, and I am running Matlab 2008a. I have found
that the latest snapshot of the JRE is working relatively
well with Matlab, which you can find at
http://download.java.net/jdk6/binaries/. I instruct Matlab
to use this JRE by adding this line

export MATLAB_JAVA=/usr/lib/jvm/jdk1.6.0_10/jre/

to the Matlab startup script which for me is located at
/usr/local/matlab76/bin/matlab (your Matlab root may differ,
and the location of your JRE may differ). One key
requirement is that you create the symbolic link from
motif21 to motif12 in the amd64 directory which for me is
located in /usr/lib/jvm/jdk1.6.0_10/jre/lib/amd64 (again
your location may differ). I have found that the old
workaround "export AWT_TOOLKIT=MToolkit" cannot be set for
any of this to work. Also know that the motif12 link is a
total kluge that I don't understand, so proceed at your own
risk. Good luck!

Cheers,
Tim

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
ubuntu Nathanael Greene 9 Oct, 2007 23:55:27
java Nathanael Greene 9 Oct, 2007 23:55:27
beryl Nathanael Greene 9 Oct, 2007 23:55:27
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com