intellij ide android building error - java

I just install intellij idea 13 ce on my mac and I open a new android project I install everything adb works fine but I have this error.
I use maverick 10.9.4
Error:Abnormal build process termination:
Exception in thread "main" 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:483)
at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:54)
Caused by: java.lang.Error: posix_spawn is not a supported process launch mechanism on this platform.
at java.lang.UNIXProcess$1.run(UNIXProcess.java:105)
at java.lang.UNIXProcess$1.run(UNIXProcess.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.UNIXProcess.<clinit>(UNIXProcess.java:92)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at io.netty.util.internal.PlatformDependent.isRoot0(PlatformDependent.java:430)

Related

How to deploy and execute javaFX application as runnable jar from eclipse when I don't have VM arguments in my project

I have written a javaFX windows application that runs great from within eclipse. I'd like to deploy it so that it can be executed on other windows computers. I have exported it as a runnable jar file. However, when I try to execute it, I get an Exception in application start method.
All the information I see online says I need to copy the VM Arguments from the project's run configurations. However, my VM Arguments text box in my project is completely blank.
I'm using eclipse with e(fx)clipse plugin installed. My project execution environment is 'JavaSE-1.8 (jre1.8.0_161)'
Here is the output when I try to run my application:
java -jar my_exported_jar.jar
Exception in Application start method
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 com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2434)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at com.st.myst25app.MainApp.initStage(MainApp.java:52)
at com.st.myst25app.MainApp.start(MainApp.java:36)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Exception running application com.st.myst25app.MainApp
I figured it out! Here are the lines of code where I was instantiating my FXMLLoader
FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("view/myfxml.fxml"));
I changed it to a full path from the root of my application and it worked:
FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("/src/path/to/view/myfxml.fxml"));

Groovysh failing to start with java.lang.NoSuchMethodError

I am runnig into an error when trying to start the groovy-shell on ubuntu (Ubuntu 18.04.1 LTS):
Version is
falk#falkpc:~$ groovysh -version
#|green Groovy Shell|# 2.4.15
But calling groovysh fails:
falk#falkpc:~$ groovysh
Gtk-Message: 18:37:05.964: Failed to load module "canberra-gtk-module"
FATAL: java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
at jline.internal.InputStreamReader.<init>(InputStreamReader.java:104)
at jline.console.ConsoleReader.setInput(ConsoleReader.java:330)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:248)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:236)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:228)
at org.codehaus.groovy.tools.shell.PatchedConsoleReader.<init>(PatchedConsoleReader.groovy:31)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:258)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.<init>(InteractiveShellRunner.groovy:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite.callConstructor(ConstructorSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:258)
at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:588)
at org.codehaus.groovy.tools.shell.Groovysh$run$0.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:169)
at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:574)
at org.codehaus.groovy.tools.shell.Groovysh$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at org.codehaus.groovy.tools.shell.Main.startGroovysh(Main.groovy:184)
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.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at org.codehaus.groovy.tools.shell.Main.main(Main.groovy:150)
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.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:116)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:138)
I was using this installation successfully for a while. I have no clue which change causes this behaviour.
Any ideas anyone?
Edit: the line "Gtk-Message: ..." no longer appers after installing
sudo apt install libcanberra-gtk-module
However this does not yet fix the error.
You need to run groovysh using Java 9 (see https://github.com/blynkkk/blynk-server/issues/752)
If you don't mind upgrading to the latest version then do:
# install Java 11 OpenJDK
sudo apt install openjdk-11-jdk
# update JAVA_HOME (you can get dir via: update-java-alternatives -l)
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
groovysh
Possibly missing library/dependency: canberra-gtk-module.
Try installing the same and later test groovysh:
sudo apt install libcanberra-gtk-module
Edited:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)
Possibly, you are using different version/bundle of JDK/JRE to compile and run.

How to export IntelliJ IDEA project as applicaiton

I am using IntelliJ IDEA version 2017.1.5, and I would like to know how to export my Java project as a runnable application for Windows or Mac. I am developing on a Windows machine.
What I want is a program that on Windows or Mac, can be installed and then run by clicking an icon, just like you would open Google Chrome, Microsoft Word or any other application. So far I have only been able to export as an executable .jar file, but when I try to run it I get the following error:
Exception in Application start method
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 com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at com.sun.javafx.scene.control.skin.Utils.computeTextWidth(Utils.java:118)
at com.sun.javafx.scene.control.skin.LabeledSkinBase.computePrefWidth(LabeledSkinBase.java:734)
at javafx.scene.control.Control.computePrefWidth(Control.java:537)
at javafx.scene.Parent.prefWidth(Parent.java:915)
at javafx.scene.layout.Region.prefWidth(Region.java:1419)
at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1728)
at javafx.scene.layout.GridPane.computePrefWidths(GridPane.java:1556)
at javafx.scene.layout.GridPane.computePrefWidth(GridPane.java:1242)
at javafx.scene.Parent.prefWidth(Parent.java:915)
at javafx.scene.layout.Region.prefWidth(Region.java:1419)
at com.sun.javafx.scene.control.skin.ScrollPaneSkin.computeScrollNodeSize(ScrollPaneSkin.java:929)
at com.sun.javafx.scene.control.skin.ScrollPaneSkin.layoutChildren(ScrollPaneSkin.java:822)
at javafx.scene.control.Control.layoutChildren(Control.java:578)
at javafx.scene.Parent.layout(Parent.java:1087)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene.preferredSize(Scene.java:1646)
at javafx.scene.Scene.impl_preferredSize(Scene.java:1720)
at javafx.stage.Window$9.invalidated(Window.java:846)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
at javafx.stage.Window.setShowing(Window.java:922)
at javafx.stage.Window.show(Window.java:937)
at javafx.stage.Stage.show(Stage.java:259)
at view.VisualInterface.start(VisualInterface.java:182)
at model.Generator.start(Generator.java:57)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Exception running application model.Generator
I would also like to note that I can't run this .jar file by double-clicking the icon in Windows Explorer, I have to run it from the command line like so:
java -jar UPCGen.jar
I would like to be able to export to both Mac and Windows. So either as a runnable .jar, or a .exe (and whatever the file extension is for Mac). Thanks in advance for any help.

Wsimport throws NoClassDefFoundError: LocalizableMessageFactory

I need to execute wsimport (Java 8) on my Mac and it fails with this error message:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/internal/ws/util/localization/LocalizableMessageFactory
at com.sun.tools.internal.ws.resources.WscompileMessages.<clinit>(WscompileMessages.java:40)
at com.sun.tools.internal.ws.wscompile.WsimportOptions.validate(WsimportOptions.java:263)
at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:159)
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:483)
at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:120)
at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 9 more
It seems, I am not the only person having this issue. Solutions that I found (and used for quite a while, was to use Java 6). Now it seems some update of OSX completly removed Java 6 from my system and I there seems to be no offical download links for Java 6 for OSX anymore.
Is there some way to get this "wsimport" working again for Java 7 or 8?

IntelliJ fails to compile with ClassNotFoundException: org.apache.log4j.Priority

I just installed IntelliJ on a new Mac OS and trying to compile a very simple basic Java app. Here is what I'm getting:
Information:2/5/15, 10:40 AM - Compilation completed with 1 error and 0 warnings in 11 sec
Error:Abnormal build process termination:
Build process started. Classpath: /Applications/IntelliJ IDEA 14 CE.app/Contents/lib/jps-launcher.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/lib/tools.jar:/Applications/IntelliJ IDEA 14 CE.app/Contents/lib/optimizedFileManager.jar:/Applications/IntelliJ IDEA 14 CE.app/Contents/lib/ecj-4.4.jar
Exception in thread "main" 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:483)
at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:58)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Priority
at io.netty.util.internal.logging.Log4JLoggerFactory.newInstance(Log4JLoggerFactory.java:29)
at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:84)
at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:77)
at io.netty.channel.MultithreadEventLoopGroup.<clinit>(MultithreadEventLoopGroup.java:32)
at org.jetbrains.jps.cmdline.BuildMain.main(BuildMain.java:96)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 10 more
Never seen this before. What can I do to fix it? I already installed IntelliJ from scratch.
There was a file in /Library/Java/Extensions called netty.jar. I deleted it and the problem disappeared.

Categories