java.lang.​ClassNotFo​undExcepti​on in matlabR2014a

150 vues (au cours des 30 derniers jours)
lida
lida le 17 Oct 2015
Commenté : decg le 28 Juil 2022
Dear All
Hi
Im using matlab R2014a. but sometimes give me following error:
Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActions.FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
why? Of course I use pycharm IDE along with matlab. Is it because it?
thanks
  2 commentaires
Takashi Li
Takashi Li le 11 Déc 2016
I also get the same problem when I open MATLAB (R2016b) while PyCharm is running.
Matheus Torquato
Matheus Torquato le 13 Mar 2021
I'm calling MATLAB functions from my Python Script and all of the blue the code freezes and MATLAB show this same message.
Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData

Connectez-vous pour commenter.

Réponse acceptée

Lane Maxwell
Lane Maxwell le 6 Nov 2017
Modifié(e) : Lane Maxwell le 3 Mai 2020
The culprit is likely the contents of the clipboard. Anything that's been copied while running the Jetbrains IDEs results in a serialized Java object being placed onto the clipboard. I assume that Matlab is reading this at startup and trying to do something with it.
There are a couple of ways to solve this. The simplest is to have an empty clipboard (or a clipboard that contains something copied outside of the Jetbrains IDEs) at the time you start Matlab.
The more flexible approach is to create a javaclasspath.txt file that contains the path to idea.jar. That jar file ships with intelliJ/PyCharm and the like. See this link for more information: Static Path - MATLAB & Simulink
  7 commentaires
Caroline Aitken
Caroline Aitken le 8 Mar 2022
Same wtih 2021b. This looks like it would be useful, but how EXACTLY do I do this? I'm not familiar enough with assigning flexible paths this way that the documentation also doesn't really help clarify. How does setting the file to contain idea.jar stop matlab from trying to look there? What do you mean by "the jar file ships with intelliJ"? I'm just not familiar enough with standard lingo and practice to understand what really needs to happen here. If you could clarify I would really appreciate it.
Lane Maxwell
Lane Maxwell le 9 Mar 2022
Hi Caroline,
Basically you have to add a file called javaclasspath.txt into your MATLAB preferences directory that contains the fully qualified path to the JAR file that contains the class in question, in this case that class is com.intellij.codeInsight.editorActions.FoldingData.
However, because that class is bundled in a jar provided by JetBrains when you install one of their products, they're free to move it around and whatnot, which they have done since I initially answered this back in 2017. That class is no longer in idea.jar, it is now in platform-impl.jar. So, on your computer, locate the platform-impl.jar file and add a line into javaclasspath.txt that points to this file, on my computer it is ~/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.6777.52/IntelliJ IDEA.app/Contents/lib/platform-impl.jar but it may be different for you.
You'll need to place the newly created javaclasspath.txt into your preferences directory for matlab, which you can find by opening matlab and running the command, prefdir. Place the file in the preferences directory and restart matlab. You can verify that it was added by running the command javaclasspath in matlab, you should see your entry at the bottom.
Even by doing this, there's a chance that you'll get other errors like if platform-impl.jar was compiled with a newer version of Java then MATLAB is using.
I have a couple other recommendations.
  1. Simply ignore the error message, it doesn't actually affect any functionality within MATLAB.
  2. Before you open MATLAB, clear your clipboard or copy something to it from outside of one of JetBrains' products.

Connectez-vous pour commenter.

Plus de réponses (6)

Kristian Sørensen
Kristian Sørensen le 23 Déc 2015
I get the same error when starting MATLAB 2015b while PyCharm CE 5.0.2 is running, and the problem disappears when PyCharm is not running.
  3 commentaires
James Dickens
James Dickens le 19 Nov 2020
This was also my problem!
decg
decg le 28 Juil 2022
Effectively.

Connectez-vous pour commenter.


Deependra Mishra
Deependra Mishra le 18 Avr 2019
I was running PyCharm earlier. Received same error with MATLAB 2019a. Copied a random text to clipboard and restarted the matlab, the error was gone.
  1 commentaire
juan li
juan li le 24 Nov 2019
Received same error with MATLAB 2019a.how to deal it

Connectez-vous pour commenter.


Barna Erdei
Barna Erdei le 19 Avr 2021
Hello, any news or solutions regarded to this topic?
I have the same error with Matlab R2020b and with the Pycharm started !
Any news about this error message ? How can we resolve this error messages ?
" Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
Exception "java.lang.ClassNotFoundException: com/intellij/openapi/editor/RawText"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.openapi.editor.RawText "
  2 commentaires
Matheus Torquato
Matheus Torquato le 19 Avr 2021
Read this. It worked for me.
Barna Erdei
Barna Erdei le 19 Avr 2021
Thank you very much! it worked also for me !

Connectez-vous pour commenter.


Morakot Choetkiertikul
Morakot Choetkiertikul le 16 Fév 2016
I also got the same problem when I open Matlab while IntelliJ is running.
Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData

Seiwev Hu
Seiwev Hu le 7 Juin 2017
I get the same error when I open MATLAB(R2014b) with the SPSS(22.0) running.
Exception "java.lang.ClassNotFoundException: com.spss.java_client.ui.doc_types.data.serialize.DataSerializer$DataCells"while constructing DataFlavor for: application/x-java-serialized-object; class=com.spss.java_client.ui.doc_types.da

Nick Ivanov
Nick Ivanov le 16 Juil 2020
I had this error with Android Studio open in Linux:
Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
After closing the Android Studio, the error disappears.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by