Hi, What is the purpose of 'Compile in MPS' check box within the solution module properties dialog? Thanks. <img src='/hc/user_images/SORN4bF0z0QTrDR1PxGczw.png'>...

This is an auto-generated question from the MPS Slack community: Hi, What is the purpose of 'Compile in MPS' check box within the solution module properties dialog? Thanks.
0
16 comments
Some solutions that are part of MPS itself need to be compiled separately for some arcane reasons. You shouldn't need to use it in normal work.
0
Okay. But when I uncheck this for an external java library, I am getting class not found error. For this external java library solution I have added 'JDK' dependency in the 'Dependencies' tab. Is that the reason why I am getting class not found exception?
0
Probably not. Can you post the stack trace?
0
Here is the stack trace. And pls. note the class 'de/tama/security/license/lib/java/LicenseException' is actually part of another jar which is actually bundled within the above said java external solution jar. Failed to initialize part class de.tama.specification.editor.license.checker.plugin.LicenseCheckerApplicationPlugin_AppPluginPart of plugin de.tama.specification.editor.license.checker java.lang.NoClassDefFoundError: de/tama/security/license/lib/java/LicenseException at de.tama.specification.editor.license.checker.plugin.LicenseCheckerApplicationPlugin_AppPluginPart.init(LicenseCheckerApplicationPlugin_AppPluginPart.java:17) at jetbrains.mps.plugins.applicationplugins.BaseApplicationPlugin.createCustomParts(BaseApplicationPlugin.java:153) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at jetbrains.mps.plugins.applicationplugins.ApplicationPluginManager.createCustomParts(ApplicationPluginManager.java:116) at jetbrains.mps.plugins.applicationplugins.ApplicationPluginManager.afterPluginsCreated(ApplicationPluginManager.java:80) at jetbrains.mps.plugins.BasePluginManager.loadPlugins(BasePluginManager.java:88) at jetbrains.mps.plugins.PluginLoaderRegistry.loadContributors(PluginLoaderRegistry.java:220) at jetbrains.mps.plugins.PluginLoaderRegistry$UpdatingTask.addContributors(PluginLoaderRegistry.java:514) at jetbrains.mps.plugins.PluginLoaderRegistry$UpdatingTask.lambda$update$2(PluginLoaderRegistry.java:491) at jetbrains.mps.classloading.ClassLoaderManager.lambda$runTransaction$2(ClassLoaderManager.java:319) at jetbrains.mps.classloading.ClassLoaderManager.runTransaction(ClassLoaderManager.java:327) at jetbrains.mps.classloading.ClassLoaderManager.runTransaction(ClassLoaderManager.java:318) at jetbrains.mps.plugins.PluginLoaderRegistry$UpdatingTask.lambda$update$3(PluginLoaderRegistry.java:461) at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:88) at jetbrains.mps.smodel.WorkbenchModelAccess.lambda$runReadAction$0(WorkbenchModelAccess.java:88) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:814) at jetbrains.mps.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:85) at jetbrains.mps.smodel.ModelAccessBase.runReadAction(ModelAccessBase.java:56) at jetbrains.mps.plugins.PluginLoaderRegistry$UpdatingTask.update(PluginLoaderRegistry.java:460) at jetbrains.mps.plugins.PluginLoaderRegistry$UpdatingTask.lambda$run$1(PluginLoaderRegistry.java:446) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:218) at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21) at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:200) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781) at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$7(ApplicationImpl.java:428) at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:134) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46) at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:797) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496) at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:1019) at com.intellij.openapi.progress.util.ProgressWindow.lambda$startBlocking$7(ProgressWindow.java:225) at com.intellij.openapi.application.impl.ApplicationImpl.runUnlockingIntendedWrite(ApplicationImpl.java:807) at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:221) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$execFromEDT$6(ProgressRunner.java:296) at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753) at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731) at java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108) at com.intellij.openapi.progress.impl.ProgressRunner.execFromEDT(ProgressRunner.java:293) at com.intellij.openapi.progress.impl.ProgressRunner.submit(ProgressRunner.java:243) at com.intellij.openapi.progress.impl.ProgressRunner.submitAndGet(ProgressRunner.java:172) at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:402) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:557) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:89) at com.intellij.openapi.progress.impl.CoreProgressManager.runSynchronously(CoreProgressManager.java:409) at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:394) at com.intellij.openapi.progress.Task.queue(Task.java:107) at jetbrains.mps.plugins.PluginLoaderRegistry.lambda$runTask$1(PluginLoaderRegistry.java:408) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:218) at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21) at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:200) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781) at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLaterOnWriteThread$10(ApplicationImpl.java:770) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46) at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.ClassNotFoundException: de.tama.security.license.lib.java.LicenseException at com.intellij.util.lang.PathClassLoader.findClass(PathClassLoader.java:64) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at jetbrains.mps.classloading.ModuleClassLoader.loadFromParent(ModuleClassLoader.java:247) at jetbrains.mps.classloading.ModuleClassLoader.loadFromDeps(ModuleClassLoader.java:238) at jetbrains.mps.classloading.ModuleClassLoader.loadClass(ModuleClassLoader.java:138) at jetbrains.mps.classloading.ModuleClassLoader.loadClass(ModuleClassLoader.java:117) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 91 more
0
Could it be that you have added the jar to the model roots but not to the Libraries?
0
I told you earlier that you don't need to add it to Libraries if it contains only resources, but you *do* need it in Libraries if it contains Java classes.
0
No, I have added the jar into the 'Libraries' as well.
0
does the jar contain that class? can you double check? it seems that you're doing everything right
0
Yes, it contains it. And this works perfectly when I check the 'Compile on MPS' checkbox.
0
Ah, that checkbox should always be checked. Not sure how it became unchecked for you.
0
sorry for the confusion
0
No probs. But I have manually unchecked this to see what happens when it is unchecked. Actually that's what I wanted to find. Anyway thanks for the help.
0
Well, this option does make sense in certain scenarios. If you develop a piece of code that is not going to be part of MPS application, e.g. need to generate classes that get compiled/bundled with an external process (e.g ant/gradle/maven). With this option on, there’s module classloader and MPS Make compiles and reloads classes of the solution. When off, there’s only generation of sources and no compilation or any classloader. Therefore, turning this option off makes sense only for ‘leaf’ solutions. If you need to use classes of the solution (or libraries it exposes) in another one (that’s what LicenseCheckerApplicationPlugin does in your scenario), you need to tell MPS how to load/access these classes/libraries, and the easiest way way is to have MPS Module Classloader available for the solution (which, as I mentioned above, is one of consequences of the unfortunate option ‘Compile in MPS’)
0
Slack user:U9XMHJEKG> Okay, thanks a lot for the information.
0
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
0

Post is closed for comments.