<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Matlab installation take 2	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/matlab-installation-take-2/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=matlab-installation-take-2</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Thu, 03 Jul 2014 21:52:31 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Java class access pitfalls &#124; Undocumented Matlab		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-327349</link>

		<dc:creator><![CDATA[Java class access pitfalls &#124; Undocumented Matlab]]></dc:creator>
		<pubDate>Thu, 03 Jul 2014 21:52:31 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-327349</guid>

					<description><![CDATA[[...] the javaclasspath.txt alternative only exists since R2012b (8.0). You can view the current Java classpath in Matlab using the javaclasspath command. [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] the javaclasspath.txt alternative only exists since R2012b (8.0). You can view the current Java classpath in Matlab using the javaclasspath command. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JSON-Matlab integration &#124; Undocumented Matlab		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-320474</link>

		<dc:creator><![CDATA[JSON-Matlab integration &#124; Undocumented Matlab]]></dc:creator>
		<pubDate>Wed, 26 Mar 2014 18:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-320474</guid>

					<description><![CDATA[[...] classpath.txt in your Matlab workspace to using javaclasspath.txt, which is much easier (however, see here). Make a file in your Matlab workspace, usually /home/MATLAB or /home/documents/matlab (e.g. on [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] classpath.txt in your Matlab workspace to using javaclasspath.txt, which is much easier (however, see here). Make a file in your Matlab workspace, usually /home/MATLAB or /home/documents/matlab (e.g. on [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-309809</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 16 Jan 2014 16:40:37 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-309809</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-309806&quot;&gt;Matt&lt;/a&gt;.

@Matt - it&#039;s in the pipeline... Matlab&#039;s toolstrip is not simple so investigating it and writing the article takes a long time. I hope to get around to it in a few months.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-309806">Matt</a>.</p>
<p>@Matt &#8211; it&#8217;s in the pipeline&#8230; Matlab&#8217;s toolstrip is not simple so investigating it and writing the article takes a long time. I hope to get around to it in a few months.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matt		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-309806</link>

		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Thu, 16 Jan 2014 16:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-309806</guid>

					<description><![CDATA[Any luck writing the article &quot;add a toolstrip to figure windows&quot;?]]></description>
			<content:encoded><![CDATA[<p>Any luck writing the article &#8220;add a toolstrip to figure windows&#8221;?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Roderick		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-192437</link>

		<dc:creator><![CDATA[Roderick]]></dc:creator>
		<pubDate>Mon, 22 Apr 2013 00:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-192437</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119&quot;&gt;Roderick&lt;/a&gt;.

@Malcolm

Doing a multi-jar build may work, however a problem still lies in having different versions in my project&#039;s Java code and Matlab libraries, say . Not having the new library available results in missing classes/methods for my project&#039;s Java code, and the *.jar might not load using the Matlab classloader. Subsequently, switching to the new version of the library by modifying the static &lt;i&gt;classpath.txt&lt;/i&gt; to load the new version results in Matlab trying to call deprecated classes or methods. To fix this would require patching the Matlab binaries which use this deprecated logic, which seems like a pretty painful job to do and to maintain for multiple Matlab machines.

Using a tool like JarJar or Maven shade in the build process allows me to rename duplicate dependencies for my own Java project, such that my own Java code can call into a different version than the default Matlab logic. This seems required to get things working.

On a side-note, after the issues observed with java dependencies and java 7, we&#039;re trying to get java RMI working. This would allow running a separate jvm1.7 with its own classpath, and as such we don&#039;t have to stress Matlab as much.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119">Roderick</a>.</p>
<p>@Malcolm</p>
<p>Doing a multi-jar build may work, however a problem still lies in having different versions in my project&#8217;s Java code and Matlab libraries, say . Not having the new library available results in missing classes/methods for my project&#8217;s Java code, and the *.jar might not load using the Matlab classloader. Subsequently, switching to the new version of the library by modifying the static <i>classpath.txt</i> to load the new version results in Matlab trying to call deprecated classes or methods. To fix this would require patching the Matlab binaries which use this deprecated logic, which seems like a pretty painful job to do and to maintain for multiple Matlab machines.</p>
<p>Using a tool like JarJar or Maven shade in the build process allows me to rename duplicate dependencies for my own Java project, such that my own Java code can call into a different version than the default Matlab logic. This seems required to get things working.</p>
<p>On a side-note, after the issues observed with java dependencies and java 7, we&#8217;re trying to get java RMI working. This would allow running a separate jvm1.7 with its own classpath, and as such we don&#8217;t have to stress Matlab as much.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-181449</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Fri, 29 Mar 2013 13:54:32 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-181449</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-180238&quot;&gt;Roderick&lt;/a&gt;.

@Roderick
A multi-jar ANT build, such as that produced by NetBeans should solve your problems without much effort.
Addition of jars is a property of Java/JVM/ANT rather than MATLAB. If a class is already loaded, it will be resolvable by the JVM and not be loaded again. 

For example, with the Waterloo graphics project only one jar is added using MATLAB javaaddpath - GraphExplorer.jar. This has many dependencies in the &quot;dist/lib&quot; folder which Java knows about via the META-INF in GraphExplorer.jar (all generated automatically in NetBeans if you select the copy dependencies to lib folder in the build settings). Just make sure that the single jar has all second, third etc order dependencies added (as Yair describes above) i.e if A.jar calls B.jar that depends on C.jar, add C.jar as well as B.jar as a dependency to A.jar.

When classes are already available through the MATLAB static java class path - they will be used and nothing extra will be loaded: Java/ANT resolves what needs to be loaded automatically. Problems arise only when there is a version conflict and then generally only if you are calling  an unsupported function. E.g., MATLAB ships with the JOGL1 openGL Java library. To use JOGL2 you would need to edit the static class path (and, in this case, also replace the OS specific binaries).

An advantage of this is you do not need a MATLAB-specific build. GraphExplorer.jar also runs as a standalone executable jar and it can be used from other environments e.g. R and SciLab when the dist/lib jars will all be loaded automatically.

Also note that any jars added through loading a single jar file are then available within MATLAB. E.g, GraphExplorer is written largely in Groovy rather than Java - so Groovy and all its built-in classes are then available in MATLAB. One of those, the GroovyClassLoader can be used to add extra jar files to the class path dynamically by specifying the URL of a jar file (much as the MATLAB javaaddpath - much easier to use than the Java equivalent). GraphExplorer (which is an LGPL project) uses that to load its GPL extensions if they are installed. The advantage here is that the supporting code is in the GraphExplorer.jar file - no need to write specifically for MATLAB again so everything works also for the stand-alone, R etc.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-180238">Roderick</a>.</p>
<p>@Roderick<br />
A multi-jar ANT build, such as that produced by NetBeans should solve your problems without much effort.<br />
Addition of jars is a property of Java/JVM/ANT rather than MATLAB. If a class is already loaded, it will be resolvable by the JVM and not be loaded again. </p>
<p>For example, with the Waterloo graphics project only one jar is added using MATLAB javaaddpath &#8211; GraphExplorer.jar. This has many dependencies in the &#8220;dist/lib&#8221; folder which Java knows about via the META-INF in GraphExplorer.jar (all generated automatically in NetBeans if you select the copy dependencies to lib folder in the build settings). Just make sure that the single jar has all second, third etc order dependencies added (as Yair describes above) i.e if A.jar calls B.jar that depends on C.jar, add C.jar as well as B.jar as a dependency to A.jar.</p>
<p>When classes are already available through the MATLAB static java class path &#8211; they will be used and nothing extra will be loaded: Java/ANT resolves what needs to be loaded automatically. Problems arise only when there is a version conflict and then generally only if you are calling  an unsupported function. E.g., MATLAB ships with the JOGL1 openGL Java library. To use JOGL2 you would need to edit the static class path (and, in this case, also replace the OS specific binaries).</p>
<p>An advantage of this is you do not need a MATLAB-specific build. GraphExplorer.jar also runs as a standalone executable jar and it can be used from other environments e.g. R and SciLab when the dist/lib jars will all be loaded automatically.</p>
<p>Also note that any jars added through loading a single jar file are then available within MATLAB. E.g, GraphExplorer is written largely in Groovy rather than Java &#8211; so Groovy and all its built-in classes are then available in MATLAB. One of those, the GroovyClassLoader can be used to add extra jar files to the class path dynamically by specifying the URL of a jar file (much as the MATLAB javaaddpath &#8211; much easier to use than the Java equivalent). GraphExplorer (which is an LGPL project) uses that to load its GPL extensions if they are installed. The advantage here is that the supporting code is in the GraphExplorer.jar file &#8211; no need to write specifically for MATLAB again so everything works also for the stand-alone, R etc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Roderick		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-180238</link>

		<dc:creator><![CDATA[Roderick]]></dc:creator>
		<pubDate>Tue, 26 Mar 2013 07:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-180238</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119&quot;&gt;Roderick&lt;/a&gt;.

Thanks for the feedback,

I&#039;ve got it working a bit better now it seems. The main solution seems to have been to extract my final jar and add this directory to the Matlab java classpath rather than to the jar itself. I was able to add the directory to both the static and dynamic path and the classes subsequently seem available. This means that it seems I can rely on Maven shade plugin to deal with duplicate dependencies and potential version conflicts.

I&#039;m aware about the java 7 problem, and have been using jvm7 in Matlab for some while now. I had to apply some patches for some issues with graphics and GUIs, and although it is still definitely not bug-free, it seems manageable. It&#039;s a pitty that R2013a still relies on the jvm6 though.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119">Roderick</a>.</p>
<p>Thanks for the feedback,</p>
<p>I&#8217;ve got it working a bit better now it seems. The main solution seems to have been to extract my final jar and add this directory to the Matlab java classpath rather than to the jar itself. I was able to add the directory to both the static and dynamic path and the classes subsequently seem available. This means that it seems I can rely on Maven shade plugin to deal with duplicate dependencies and potential version conflicts.</p>
<p>I&#8217;m aware about the java 7 problem, and have been using jvm7 in Matlab for some while now. I had to apply some patches for some issues with graphics and GUIs, and although it is still definitely not bug-free, it seems manageable. It&#8217;s a pitty that R2013a still relies on the jvm6 though.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178298</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 22 Mar 2013 09:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-178298</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119&quot;&gt;Roderick&lt;/a&gt;.

@Roderick - indeed, Matlab is not very verbose when failing to instantiate a class as to the underlying failure reason (to say the least). You could try placing all your classes as standalone files in some folder and then add the folder via &lt;i&gt;&lt;b&gt;javaaddpath&lt;/b&gt;&lt;/i&gt;, then you would at least be able to test on a class-by-class basis. You should run &lt;i&gt;&lt;b&gt;which&lt;/b&gt;(FQCN)&lt;/i&gt; before the &lt;i&gt;&lt;b&gt;javaaddpath&lt;/b&gt;&lt;/i&gt;, to ensure that the class is not already defined somewhere in Matlab. If all your classes reside in a dedicated package (e.g., roderick.MyClass) then this should not be an issue. This would then narrow things down to an instantiation problem. Ensure that both your class AND its constructor are public, then ensure that your are passing the correct params to your constructor.

If all this fails, then a possible reason is that the class references some other class that is not available on the java classpath. For example, class A might call B.method() somewhere (in whichever function), and if B is not available then instatiating A in Matlab will fail without telling you that the actual reason is B and not A...

A final reason might be that the class files were compiles using a newer Java release than Matlab is using - a typical case is using Java 7 rather than Java 6.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119">Roderick</a>.</p>
<p>@Roderick &#8211; indeed, Matlab is not very verbose when failing to instantiate a class as to the underlying failure reason (to say the least). You could try placing all your classes as standalone files in some folder and then add the folder via <i><b>javaaddpath</b></i>, then you would at least be able to test on a class-by-class basis. You should run <i><b>which</b>(FQCN)</i> before the <i><b>javaaddpath</b></i>, to ensure that the class is not already defined somewhere in Matlab. If all your classes reside in a dedicated package (e.g., roderick.MyClass) then this should not be an issue. This would then narrow things down to an instantiation problem. Ensure that both your class AND its constructor are public, then ensure that your are passing the correct params to your constructor.</p>
<p>If all this fails, then a possible reason is that the class references some other class that is not available on the java classpath. For example, class A might call B.method() somewhere (in whichever function), and if B is not available then instatiating A in Matlab will fail without telling you that the actual reason is B and not A&#8230;</p>
<p>A final reason might be that the class files were compiles using a newer Java release than Matlab is using &#8211; a typical case is using Java 7 rather than Java 6.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Roderick		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-178119</link>

		<dc:creator><![CDATA[Roderick]]></dc:creator>
		<pubDate>Fri, 22 Mar 2013 02:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-178119</guid>

					<description><![CDATA[Hey Yair,

Any idea about how the new javaclasspath.txt handles duplicate dependencies to the standard Matlab included jars? Does Matlab actually do something with duplicate dependencies and with potential version conflicts in this case?

Fyi, for the last couple of days I&#039;ve been boxing my head against a wall trying to get a big java project imported into Matlab. To handle version conflicts in the dependencies (which there are and which I can find with trying to add separate jars to the dynamic path), I&#039;ve tried using the Maven shade plugin for renaming all common classes between matlab and my java project and packaging this into one big jar. Seemed like a decent approach. However, after trying to add this final jar to either the static or dynamic classpath, I don&#039;t get any errors from Matlab and it signals that it has indeed added it when calling javaclasspath(), while I cannot call into any class located within this jar. I&#039;ve tried different routes of finding out why Matlab doesn&#039;t pick it up, but cannot seem to get anywhere.]]></description>
			<content:encoded><![CDATA[<p>Hey Yair,</p>
<p>Any idea about how the new javaclasspath.txt handles duplicate dependencies to the standard Matlab included jars? Does Matlab actually do something with duplicate dependencies and with potential version conflicts in this case?</p>
<p>Fyi, for the last couple of days I&#8217;ve been boxing my head against a wall trying to get a big java project imported into Matlab. To handle version conflicts in the dependencies (which there are and which I can find with trying to add separate jars to the dynamic path), I&#8217;ve tried using the Maven shade plugin for renaming all common classes between matlab and my java project and packaging this into one big jar. Seemed like a decent approach. However, after trying to add this final jar to either the static or dynamic classpath, I don&#8217;t get any errors from Matlab and it signals that it has indeed added it when calling javaclasspath(), while I cannot call into any class located within this jar. I&#8217;ve tried different routes of finding out why Matlab doesn&#8217;t pick it up, but cannot seem to get anywhere.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-124382</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 18:01:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3140#comment-124382</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-124377&quot;&gt;Brian&lt;/a&gt;.

You may be encountering memory-swapping issues, so try restarting the computer and monitoring the process memory while running your simulation. I&#039;m afraid I don&#039;t have anything smarter to suggest except contacting MathWorks customer service.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-installation-take-2#comment-124377">Brian</a>.</p>
<p>You may be encountering memory-swapping issues, so try restarting the computer and monitoring the process memory while running your simulation. I&#8217;m afraid I don&#8217;t have anything smarter to suggest except contacting MathWorks customer service.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
