Netbeans not opening in Ubuntu when opened from terminal, The following error is displayed.
java.lang.NoClassDefFoundError: java/nio/file/InvalidPathException
at org.openide.filesystems.FileUtil.normalizeFileImpl(Unknown Source)
at org.openide.filesystems.FileUtil.normalizeFile(Unknown Source)
at org.netbeans.core.startup.TopLogging.printSystemInfo(Unknown Source)
at org.netbeans.core.startup.TopLogging.initialize(Unknown Source)
at org.netbeans.core.startup.TopLogging.initialize(Unknown Source)
at org.netbeans.core.startup.CLIOptions.initialize(Unknown Source)
at org.netbeans.core.startup.Main.start(Unknown Source)
at org.netbeans.core.startup.TopThreadGroup.run(Unknown Source)
at java.lang.Thread.run(Thread.java:701)
Caused by: java.lang.ClassNotFoundException:
java.nio.file.InvalidPathException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
... 9 more
pls help me ...
Netbeans did not open on the command because the shell does not know the path to your binary file.
If binary files are located in /usr/bin (the default path to application's binary files) they will open right away
Related
I'm getting this weird issue when my colleague runs my Jar in JRE of same version as my development environment (Java1.7 + Eclipse Indiago).
Add a Jar to build path and refer to some Classes in this jar;
Compile, run the project as Java application successfully in Eclipse;
Export the project as Runnable Jar with option - 'Package required libraries into generated Jar'.
Run the exported Jar in command line 'java -jar xxx.jar' in my computer and get expected result.
Run the same Jar in another computer with same JRE but get something error like 'ClassNotFound' telling that the class referred from inner Jar can not be found, as shown below:
Exception in thread "main" java.lang.NoClassDefFoundError: com/test/commo
n/communication/BaseNotificationEvent
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)
Caused by: java.lang.ClassNotFoundException: com.test.common.communicatio
n.BaseNotificationEvent
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
The solution so far is to export runnable jar with option 'copy required libraries into sub-folder next to generated Jar', and this works both in my and another computer.
But I am not take this as ultimate solution for I have to transfer multiple files rather a single Jar while releasing my program...which seems not elegant ^_^
I have a java program that uses dynamic reports fine in netbeans, and even works in exe and jar when I first run it. However, if I share the jar/exe (I've even sent it and re-downloaded it on my own computer), I get an error java.lang.classnotfoundexception: net.sf.jasperreports.engine.jrdatasource. However, I have double checked my jars and I do have this class. What could be the source of this problem then?
Thanks
Edit: full error:
Exception in thread "main" java.lang.NoClassDefFoundError:
net/sf/jasperreports/engine/JRDataSource
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
net.sf.jasperreports.engine.JRDataSource
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
if you get Caused by: java.lang.ClassNotFoundException: inside a jar file then, you need to provide the classpath arguments;
example:
java -cp my.jar -jar ExternalJarFileName.jar
you can also provide all jars use below command, only need to create a directory and put all external jars in to it and use path of directory in to below command:
java -cp my.jar;C:\externalJar\* mainpackage.MainClass
I get this exception after exporting into a .jar file with eclipse. IntelliJ says the same. But my program is working fine in eclipse.
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
What could be the matter of this?
JDK version: 1.7.0_79
Starting: java -jar myapp.jar
After trying it with java -cp jfxrt.jar -jar myapp.jar it gives me the following error:
java -cp jfxrt.jar -jar memo.jar
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$100(LauncherImpl.java:352)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
... 5 more
The javafx.application.Application class is going to be found in a javafx library; in an IDE such as eclipse you generally configure a project to refer to those libraries it needs for compilation and execution. When you put your code into a jar and run it outside the IDE, you need to provide the library to the runtime a different way.
A standard way to do this is to set a classpath which has references to both the application jar and to any libraries it needs; the DOS command to do this would look something like:
set classpath=c:\myProjects\myApplication\myJar.jar;c:\java\libaries\javafx\jfxrt.jar
and then java would have access to the classes in both those jar files
Oracle JDK includes JavaFX on the classpath from version 1.8 onwards; if you upgrade your JDK to version 8 or later it should run. I do not recommend building production-level JavaFX applications with versions prior to Java 8 anyway.
If you really do want to use Java 7, consider using the built-in JavaFX deployment tools to build the jar, instead of the vanilla "create executable jar" from eclipse. These will properly build a jar file that includes the FX runtime, if needed. The easiest way to do this in Eclipse is to install e(fx)clipse (an Eclipse plugin); there's a tutorial which includes steps to build the jar file.
I get this exception after exporting into a .jar file with eclipse. IntelliJ says the same. But my program is working fine in eclipse.
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
What could be the matter of this?
JDK version: 1.7.0_79
Starting: java -jar myapp.jar
After trying it with java -cp jfxrt.jar -jar myapp.jar it gives me the following error:
java -cp jfxrt.jar -jar memo.jar
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$100(LauncherImpl.java:352)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
... 5 more
The javafx.application.Application class is going to be found in a javafx library; in an IDE such as eclipse you generally configure a project to refer to those libraries it needs for compilation and execution. When you put your code into a jar and run it outside the IDE, you need to provide the library to the runtime a different way.
A standard way to do this is to set a classpath which has references to both the application jar and to any libraries it needs; the DOS command to do this would look something like:
set classpath=c:\myProjects\myApplication\myJar.jar;c:\java\libaries\javafx\jfxrt.jar
and then java would have access to the classes in both those jar files
Oracle JDK includes JavaFX on the classpath from version 1.8 onwards; if you upgrade your JDK to version 8 or later it should run. I do not recommend building production-level JavaFX applications with versions prior to Java 8 anyway.
If you really do want to use Java 7, consider using the built-in JavaFX deployment tools to build the jar, instead of the vanilla "create executable jar" from eclipse. These will properly build a jar file that includes the FX runtime, if needed. The easiest way to do this in Eclipse is to install e(fx)clipse (an Eclipse plugin); there's a tutorial which includes steps to build the jar file.
I made some small game and I want to export it.I export it as runnable JAR file but when I try to open it nothing happens. I am using couple of external libraries(slick, jinput, jogg, jorbis and jwjgl). Can someone help me make my program work? This is my error screen:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58 )
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.openal.AL.<clinit>(AL.java:59)
at org.newdawn.slick.openal.SoundStore$1.run(SoundStore.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.openal.SoundStore.init(SoundStore.java:292)
at org.newdawn.slick.Sound.<init>(Sound.java:54)
at com.pitcher654.main.AudioPlayer.load(AudioPlayer.java:18)
at com.pitcher654.main.Game.<init>(Game.java:60)
at com.pitcher654.main.Game.main(Game.java:317)
... 5 more