Faing difficulty in building eucalyptus on ubuntu 12.04 - java

I installed Ubuntu 12.04(precise)64-bit alongside MacBookPro OS which its processor :Intel® Core™ i5-3210M CPU # 2.50GHz × 4. Then I am trying for several days to install eucalyptus 3.2.0 by following this guide.
When I reached the build phase, it failed due to this issue :
BUILD FAILED
/home/asma/eucalyptus-3.2.0/clc/build.xml:111: The following error occurred while executing this line:
java.lang.UnsupportedClassVersionError: org/codehaus/groovy/ant/Groovy : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1124)
at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1295)
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1351)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at org.apache.tools.ant.AntTypeDefinition.innerGetTypeClass(AntTypeDefinition.java:194)
at org.apache.tools.ant.AntTypeDefinition.getTypeClass(AntTypeDefinition.java:168)
at org.apache.tools.ant.AntTypeDefinition.icreate(AntTypeDefinition.java:215)
at org.apache.tools.ant.AntTypeDefinition.create(AntTypeDefinition.java:206)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:286)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:264)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:417)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 0 seconds
make[1]: *** [build] Error 1
make[1]: Leaving directory `/home/asma/eucalyptus-3.2.0/clc'
make: *** [build] Error 2
Ff course I searched and googled, but all solutions state that make sure that java and javac versions are the same since this issue occurs when with java version of compile and run is conflicting. I have the same version for java and javac which is :
asma#asma-MacBookPro:~$ java -version
java version "1.6.0_31"
OpenJDK Runtime Environment (IcedTea6 1.13.3) (6b31-1.13.3-1ubuntu1~0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
asma#asma-MacBookPro:~$ javac -version
javac 1.6.0_31
Here is ant version :
asma#asma-MacBookPro:~$ ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
I have only openjdk-6-jdk installed on my Ubuntu right now and I removed java7. Also I tried to have only openjdk-7-jdk but the build still was not successful.
What would be the reason for this error ? Any thoughts or suggestions? May I need to alter build.xml?

During the build process for Eucalyptus, it will perform a submodule checkout of github.com/euaclyptus/eucalyptus-cloud-libs which contains the jars necessary to build from source. When building older versions of Eucalyptus, it doesn't always checkout the correct tag/branch for cloud-libs. If you go into eucalyptus/clc/lib and do a git status you should be able to see which branch is checked out. If it is #testing, then the build will not work because the dependencies have changed quite a bit since 3.2.0. I believe there is a tag for 3.2.2 that may work correctly. Because of the way that the build process does the checkout on that folder, it may not be as easy as doing git checkout. Instead, you may have to delete that folder and manually checkout the eucalyptus-cloud-libs repository which is a large-ish download.
Btw - while working on Eucalyptus, we use Java7, so you are better off installing it instead of 6.
If you are building from source, I would suggest trying to build from #testing, rather than an older release. Although Ubuntu is not supported, I have built Eucalyptus and run it on Ubuntu in the past. That guide is as good as any, but be prepared to perform some hackery. I vaguely remember commenting out some unit tests in Makefiles to make the build succeed.

Related

FTB Infinity Evolved server not starting with JDK 8

I have downloaded and unzipped the FTB Infinity server from CurseForge on my Arch Linux machine and run both the install and run scripts, and I am presented with this error:
Starting server
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=256M; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12)
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Level
at net.minecraft.launchwrapper.Launch.launch(Launch.java:94)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Level
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 8 more
My directory listing:
changelogs FTBserver.jar ServerStart.sh
config libraries settings.bat
eula.txt minecraft_server.1.7.10.jar settings.sh
FTBInstall.bat modpack version.json
FTBInstall.sh mods
FTBServer-1.7.10-1614.jar ServerStart.bat
I looked at all of the questions online, and most of them said to install jdk 8, but I am already using it. Any ideas?
Okay, so this is pretty dumb of the install script. It downloaded an XML file saying that the jar could not be found instead of the actual jar. (laughs) I should probably report that.

Maven 3.8.4 target produces exception stacks

Until today I have used Maven 3.8.3. It worked fine.
Now, I have downloaded and unzipped Maven 3.8.4 and adapt the environment variables to this new path.
After restarting the console (and the complete system), "mvn -version" worked fine and shows the correct version of maven, but I am not able to build any project anymore.
After calling "mvn clean package" I receive hundreds of exception stacks; the last lines are:
...
constituent[0]: file:/C:/mypath/apache-maven-3.8.4/conf/logging/
constituent[1]: file:/C:/mypath/apache-maven-3.8.4/lib/commons-cli-1.4.jar
constituent[2]: file:/C:/mypath/apache-maven-3.8.4/lib/commons-io-2.6.jar
constituent[3]: file:/C:/mypath/apache-maven-3.8.4/lib/commons-lang3-3.8.1.jar
constituent[4]: file:/C:/mypath/apache-maven-3.8.4/lib/guava-25.1-android.jar
constituent[5]: file:/C:/mypath/apache-maven-3.8.4/lib/guice-4.2.2-no_aop.jar
constituent[6]: file:/C:/mypath/apache-maven-3.8.4/lib/jansi-2.4.0.jar
constituent[7]: file:/C:/mypath/apache-maven-3.8.4/lib/javax.annotation-api-1.2.jar
constituent[8]: file:/C:/mypath/apache-maven-3.8.4/lib/javax.inject-1.jar
constituent[9]: file:/C:/mypath/apache-maven-3.8.4/lib/jcl-over-slf4j-1.7.32.jar
constituent[10]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-artifact-3.8.4.jar
constituent[11]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-builder-support-3.8.4.jar
constituent[12]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-compat-3.8.4.jar
constituent[13]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-core-3.8.4.jar
constituent[14]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-embedder-3.8.4.jar
constituent[15]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-model-3.8.4.jar
constituent[16]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-model-builder-3.8.4.jar
constituent[17]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-plugin-api-3.8.4.jar
constituent[18]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-repository-metadata-3.8.4.jar
constituent[19]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-resolver-api-1.6.3.jar
constituent[20]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-resolver-connector-basic-1.6.3.jar
constituent[21]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-resolver-impl-1.6.3.jar
constituent[22]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-resolver-provider-3.8.4.jar
constituent[23]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-resolver-spi-1.6.3.jar
constituent[24]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-resolver-transport-wagon-1.6.3.jar
constituent[25]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-settings-3.8.4.jar
constituent[26]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-settings-builder-3.8.4.jar
constituent[27]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-shared-utils-3.3.4.jar
constituent[28]: file:/C:/mypath/apache-maven-3.8.4/lib/maven-slf4j-provider-3.8.4.jar
constituent[29]: file:/C:/mypath/apache-maven-3.8.4/lib/org.eclipse.sisu.inject-0.3.5.jar
constituent[30]: file:/C:/mypath/apache-maven-3.8.4/lib/org.eclipse.sisu.plexus-0.3.5.jar
constituent[31]: file:/C:/mypath/apache-maven-3.8.4/lib/plexus-cipher-2.0.jar
constituent[32]: file:/C:/mypath/apache-maven-3.8.4/lib/plexus-component-annotations-2.1.0.jar
constituent[33]: file:/C:/mypath/apache-maven-3.8.4/lib/plexus-interpolation-1.26.jar
constituent[34]: file:/C:/mypath/apache-maven-3.8.4/lib/plexus-sec-dispatcher-2.0.jar
constituent[35]: file:/C:/mypath/apache-maven-3.8.4/lib/plexus-utils-3.3.0.jar
constituent[36]: file:/C:/mypath/apache-maven-3.8.4/lib/slf4j-api-1.7.32.jar
constituent[37]: file:/C:/mypath/apache-maven-3.8.4/lib/wagon-file-3.4.3.jar
constituent[38]: file:/C:/mypath/apache-maven-3.8.4/lib/wagon-http-3.4.3-shaded.jar
constituent[39]: file:/C:/mypath/apache-maven-3.8.4/lib/wagon-provider-api-3.4.3.jar
---------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.google.inject.spi.InjectionPoint.getDeclaredMethods(InjectionPoint.java:766)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:683)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:378)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:182)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:661)
at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:617)
...
at org.apache.maven.cli.MavenCli.container(MavenCli.java:691)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: java.lang.ClassNotFoundException: org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 135 more
The paths to 3.8.3 and 3.8.4 look exactly the same. The lib-directory including the jar-files inside of the maven directories exists in both cases. Can somebody give me any advice what I am doing wrong here?
Advice: I am not using "eclipse" as an IDE here, I try to build the project on cmd.
I am using the following Java:
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (Temurin)(build 25.312-b07, mixed mode)

Weblogic Error - Could not initialize class weblogic.jndi.Environment

When I try to debug a WebApp configured to run with Oracle Weblogic Server from NetBeans 10, I always get the following error:
There's not even complicated steps, I just open my project and then right-click / Debug.
java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:178)
at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(ClientProviderBase.java:84)
at java.management/javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:378)
at org.netbeans.modules.j2ee.weblogic9.WLConnectionSupport$1.call(WLConnectionSupport.java:182)
at org.netbeans.modules.j2ee.weblogic9.WLConnectionSupport.executeAction(WLConnectionSupport.java:112)
at org.netbeans.modules.j2ee.weblogic9.WLConnectionSupport.executeAction(WLConnectionSupport.java:161)
at org.netbeans.modules.j2ee.weblogic9.deploy.WLDeploymentManager.getTargets(WLDeploymentManager.java:632)
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.getTargetMap(ServerInstance.java:560)
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.getTargets(ServerInstance.java:518)
at org.netbeans.modules.j2ee.deployment.impl.ServerString.getTargets(ServerString.java:117)
at org.netbeans.modules.j2ee.deployment.impl.ServerString.toTargets(ServerString.java:155)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:146)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.undeploy(TargetServer.java:771)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.undeploy(Deployment.java:337)
at org.netbeans.modules.j2ee.ant.Undeploy.execute(Undeploy.java:92)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
BUILD FAILED (total time: 0 seconds)
My environment is:
NetBeans 10 running on Java 10.0.2+13
Windows 10
Weblogic Server 10.3.6 running on Java 1.6.0.45
How to fix?
For Eclipse IDE, the solution for me was to switch from JDK11 to JDK8 on the client.
I've decided to post this question because it took me the whole morning to find a solution... especially because the most common reason for java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment to occur, is when weblogic.jar and wlfullclient.jar aren't being properly located by any of IDE, WebApp, or WL.
To fix the issue just run your project using NetBeans 8.2, this seems to be a bug at NB10 only.
Also, don't even try running it on NB11, NB12, NB12.1 nor NB12.2. Currently, Java EE plugin for those versions is discontinued so you'll not even be able to add WL to your server list.
The reason it broke in NB10 is that they started removing Java 8 vendor features from it, And the reason it doesn't even is possible to add WL to NB11 > is because Oracle removed JDK8 features for the followed releases of Java... NB integration is not under Apache Licence so they just aren't giving support to it now (is an issue that they refused to fix). However, with a bit of risk, it can be added manually.

Scala under MSys2 - failure to initialize terminal

My environment is Windows 10 x64/Scala 2.11.7/Msys2 latest.
When running Scala from MSys2 console, I see the following:
$ scala
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
at jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:204)
at jline.WindowsTerminal.init(WindowsTerminal.java:82)
at jline.TerminalFactory.create(TerminalFactory.java:101)
at jline.TerminalFactory.get(TerminalFactory.java:158)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:229)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
at scala.tools.nsc.interpreter.jline.JLineConsoleReader.<init>(JLineReader.scala:61)
at scala.tools.nsc.interpreter.jline.InteractiveReader.<init>(JLineReader.scala:33)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at scala.tools.nsc.interpreter.ILoop$$anonfun$scala$tools$nsc$interpreter$ILoop$$instantiate$1$1.apply(ILoop.scala:865)
at scala.tools.nsc.interpreter.ILoop$$anonfun$scala$tools$nsc$interpreter$ILoop$$instantiate$1$1.apply(ILoop.scala:862)
at scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$mkReader$1(ILoop.scala:871)
at scala.tools.nsc.interpreter.ILoop$$anonfun$15$$anonfun$apply$8.apply(ILoop.scala:875)
at scala.tools.nsc.interpreter.ILoop$$anonfun$15$$anonfun$apply$8.apply(ILoop.scala:875)
at scala.util.Try$.apply(Try.scala:192)
at scala.tools.nsc.interpreter.ILoop$$anonfun$15.apply(ILoop.scala:875)
at scala.tools.nsc.interpreter.ILoop$$anonfun$15.apply(ILoop.scala:875)
at scala.collection.immutable.Stream.map(Stream.scala:418)
at scala.tools.nsc.interpreter.ILoop.chooseReader(ILoop.scala:875)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1$$anonfun$apply$mcZ$sp$2.apply(ILoop.scala:916)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:916)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:911)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:911)
at scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:97)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:911)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_79).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
When running it from cmd.exe, it works as expected. To debug the issue, I tried the following Scala program:
object Test extends App {
println(org.fusesource.jansi.internal.WindowsSupport.getConsoleMode)
}
When run from Msys2, it produces the following error:
java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path]
at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
at org.fusesource.jansi.internal.Kernel32.<clinit>(Kernel32.java:37)
at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
at Test$.delayedEndpoint$Test$1(Test.scala:5)
at Test$delayedInit$body.apply(Test.scala:1)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at Test$.main(Test.scala:1)
at Test.main(Test.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at scala.reflect.internal.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:70)
at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:101)
at scala.reflect.internal.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:70)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101)
at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:22)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:39)
at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:29)
at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:39)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:65)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
What I tried and it didn't work:
Some threads on the internet mention that it might be caused by missing VC2008 runtime, so I made sure that I have it both for x64 and x86.
Extracting jansi.dll from scala/lib/jline-2.12.1.jar and putting it in my working directory (with "." included in java.library.path).
Starting with a fresh MSys2 home directory.
running bash --login -i from cmd.exe (same error when running scala)
trying 32-bit and 64-bit JREs
One more thing: the issue doesn't affect sbt; for example, running "sbt console" gives me a working Scala command line, albeit of version 2.10.4.
The problem is caused by the name clash between the scala shell script in scala/bin directory and scala.bat in the same directory. Msys2 runs the shell script, while cmd.exe runs the batch file. Apparently, the shell script is not suited for Msys2, which causes the error that I witnessed. Issuing cmd //c scala.bat from MSys2 results in a functional Scala command line.
It is also trivial to edit the scala shell script to support MSys2: https://gist.github.com/kirillkh/a9ba2e00ef2e901f13bf
I have opened a pull request with this change on the GitHub: https://github.com/scala/scala/pull/4674

Executing headless eclipse in command line

Following this instruction, I could run headless Eclipse plugin in side Eclipse IDE.
I've got some error log info, but I guess I could ignore it based on this post - Unable to find feature.xml in directory
Following the instruction in site, I could generate the jar file. After copying the org.eclipse.equinox.launcher.jar, I tried to execute the jar file
java -jar org.eclipse.equinox.launcher_1.2.0.v20110502.jar -application headlessHello_1.0.0.201210101430.jar
I tried
java -cp .:org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.core.launcher.Main -application headlessHello_1.0.0.201210101430.jar
to get error message
An error has occurred. See the log file
/Users/users/Desktop/configuration/1349897444823.log
with this log file
!SESSION Wed Oct 10 14:30:44 CDT 2012 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2012-10-10 14:30:44.843
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.RuntimeException: Could not find framework
at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:978)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:557)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
ADDED
From this site, the issue was because I didn't setup %R2_HOME%/plugins correctly. After the setup, I still get the error.
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
at org.eclipse.core.launcher.Main.main(Main.java:34)
An instance of headless Eclipse needs to include many plugins, not just your plugin. A minimal product includes:
org.eclipse.core.runtime
org.eclipse.core.variables
<your plugin(s) here>
EDIT
I generated the product, and here is the list of plugins used by my "minimal" headless Eclipse:
I output the product, and here is the list of plugins loaded:
org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar
org.eclipse.core.jobs_3.5.1.R36x_v20100824.jar
org.eclipse.core.runtime.compatibility.auth_3.2.200.v20100517.jar
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520
org.eclipse.core.runtime_3.6.0.v20100505.jar
org.eclipse.equinox.app_1.3.1.R36x_v20100803.jar
org.eclipse.equinox.common_3.6.0.v20100503.jar
org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
org.eclipse.equinox.preferences_3.3.0.v20100503.jar
org.eclipse.equinox.registry_3.5.0.v20100503.jar
org.eclipse.osgi.services_3.2.100.v20100503.jar
org.eclipse.osgi.util_3.2.100.v20100503.jar
org.eclipse.osgi_3.6.2.R36x_v20110210.jar
So, might I recommend that you create a product for this Eclipse application you are building, and try that. Looking for a FAQ I found this. http://wiki.eclipse.org/FAQ_What_is_the_minimal_Eclipse_configuration%3F

Categories