im2java2d, two *identical* PCs, works on one not on another

1 view (last 30 days)
Good morning,
I'm having a bit of trouble using my code (that includes calling the im2java2d function) on a different computer than I developed it on. The weird part is that I can't tell how the two PCs differ in their setup to cause this problem.
Both PCs are running ubuntu 12.04, and matlab r2012a.
On the problematic PC, the error"
Error using im2java2d (line 80)
IM2JAVA2D is not available on this platform.
is returned.
Line 80 error is thrown because this conditional (below) is found to be true on the troubled machine.
if ~IsJavaAvailable
error(message('images:im2java2d:im2java2dNotAvailableOnThisPlatform'));
end
Interestingly, I made a copy of the im2java2d function and commented lines 79-81, and the function progresses as expected and returns the proper output.
What is going wrong to cause this error to be thrown?
Thanks, Brian
p.s. I should perhaps make note that I am running matlab on the problematic machine via command line (matlab -nodisplay) through an ssh and gnu-screen session, because this machine is remote from where I typically work.
EDIT: it seems that the restriction is using this function via command line. Can someone please explain why not all java functions are available via command line?
  1 Comment
Gonzalo Garateguy
Gonzalo Garateguy on 4 Oct 2013
I think it has to do with the desktop, I had the same problem but if you start matlab with -nodisplay because there are some java classes that are not available I start doing it with -nodesktop instead and everyting worked fine.
If you can do x11 tunneling to the server you can even launch matlab with the desktop but it will be painfully slow.
other option is to set the display to the local display of the server before starting matlab with
% setenv DISPLAY localhost:0.0 and then % matlab -nodesktop
Hope it helps

Sign in to comment.

Answers (0)

Categories

Find more on Java Package Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!