Issue: When I try to run a java program on my personal machine I recieve the following error:   Exception in thread "main" java.lang.NoClassDefFoundError: ecs100/UI     at BallDrop.&lt;init&gt;(BallDrop.java:37)     at BallDrop.main(BallDrop.java:63) Caused by: java.lang.ClassNotFoundException: ecs100.UI     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)   Explanation: I am required to write a program using an external library 'ecs100'. It has been supplied as a .jar mime-type file.  I have the file test.java:   import ecs100.*; class test{     public static void main(String args[]){         System.out.println('Test string');         UI.initialise(); //this is just how the library is supposed to be used     } }   I have tried compiling with the command: javac -cp esc100.jar test.java, which appears to load correctly.  Then when I attempt to run with the command java test it gives the error I specified.  Details: I have been told that the library was written for oracle java 8. I have attempted to compile and run with oracle java 8 JDK, oracle java 9 JDK and openJDK 9 or 8.  I am running ubuntu 16.10. And I do not have any nVidia drivers installed (apparently that can cause problems).  I have tried running files compiled successfully from another computer. Even if they ran on that computer, no luck with mine.  The command java -version outputs:   java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)  The command javac -verison outputs:  javac 1.8.0_121  Conclussion: I would greatly appreciate any feedback or suggestions.  I imagine I'm either doing something wrong with:   The classpath in compilation The import statement A missing dependancy Wrong use of one of the commands   I am basically positive the problem is not one of the following:   An issue with the way I am using the library
785
I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?
20118
Does anyone know how to programmaticly find out where the java classloader actually loads the class from?    I often work on large projects where the classpath gets very long and manual searching is not really an option.  I recently had a  where the classloader was loading an incorrect version of a class because it was on the classpath in two different places.  So how can I get the classloader to tell me where on disk the actual class file is coming from?  Edit: What about if the classloader actually fails to load the class due to a version mismatch (or something else),  is there anyway we could find out what file its trying to read before it reads it?
61954
Note I'm running windows, the path just looks like it's linus because I typed it manually and thats how I think of paths.  I'm trying to run a java class That I have built to diagnose my connection to a databse, it references the oracle jdbc adaptor.  When I just run it without a class path:  %&gt; java DBDiagnostics &lt;connectionString&gt;   I get an exception when it reaches the following line of code:  Class.forName("oracle.jdbc.pool.OracleDataSource").newInstance();   with the following exception:  java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)         at java.lang.Class.forName0(Native Method)         at java.lang.Class.forName(Class.java:169)         at DBDiagnostics.GetConnection(DBDiagnostics.java:43)         at DBDiagnostics.runDiagnostic(DBDiagnostics.java:29)         at DBDiagnostics.main(DBDiagnostics.java:18) Creating connection. java.sql.SQLException: No suitable driver found for lskd         at java.sql.DriverManager.getConnection(DriverManager.java:602)         at java.sql.DriverManager.getConnection(DriverManager.java:207)         at DBDiagnostics.GetConnection(DBDiagnostics.java:55)         at DBDiagnostics.runDiagnostic(DBDiagnostics.java:29)         at DBDiagnostics.main(DBDiagnostics.java:18) Veryfying connectivity to Database Exception in thread "main" java.lang.NullPointerException         at DBDiagnostics.verifyTable(DBDiagnostics.java:86)         at DBDiagnostics.verifyTable(DBDiagnostics.java:76)         at DBDiagnostics.verifyDatabseConnectivity(DBDiagnostics.java:68)         at DBDiagnostics.runDiagnostic(DBDiagnostics.java:36)         at DBDiagnostics.main(DBDiagnostics.java:18)   I assume that this is because I need to include it in the classpath.   So, I tried adding it to the classpath like this:  %&gt; java -classpath .:ojdbc6.jar DBDiagnostics &lt;connectionString&gt;   The VM just says it cant find the class:   Exception in thread "main" java.lang.NoClassDefFoundError: DBDiagnostics Caused by: java.lang.ClassNotFoundException: DBDiagnostics         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: DBDiagnostics.  Program will exit.   I know this is a question I should just know the answer to, but what am I doing wrong?
61801
I'm new to Ubuntu, using 18.04 and trying to install Netbeans or Eclipse but neither of them works.  At first my java was version 10. Searching for solutions I found many suggestions to install version 8 so I installed that and changed my default java to 8, but I'm getting new errors.  Here is the error of eclipse which is in its configuration folder (after running eclipse from terminal, eclipse guided me there to see the error):  !SESSION Sat Jun 09 15:21:19 CEST 2018 ----------------------------------------- !ENTRY org.eclipse.equinox.launcher 4 0 2018-06-09 15:21:19.382 !MESSAGE Exception launching the Eclipse Platform: !STACK java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:626)     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)     at org.eclipse.equinox.launcher.Main.run(Main.java:1438)     at org.eclipse.equinox.launcher.Main.main(Main.java:1414)   Netbeans doesn't even give error messages - it just can't load.  Again I searched to see what is wrong it seems these applications even need older versions of java but I can't find any older version. (java doesn't support them)  Can someone please help?
23782
My minecraft will not start on only that version, I have a Windows 7 computer with Java 8u20 installed, because the latest java 7 update will not work at all(plus imma dev for other stuff).   [22:26:39] [main/INFO] [LaunchWrapper]: Loading tweak class name   cpw.mods.fml.common.launcher.FMLTweaker  [22:26:39] [main/INFO] [LaunchWrapper]: Using primary tweak class name   cpw.mods.fml.common.launcher.FMLTweaker  [22:26:39] [main/INFO] [LaunchWrapper]: Calling tweak class   cpw.mods.fml.common.launcher.FMLTweaker  [22:26:40] [main/INFO] [FML]: Forge Mod Loader version 7.10.25.1208 for Minecraft   1.7.10 loading  [22:26:40] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version   1.8.0_20, running on Windows 7:amd64:6.1, installed at C:\Program   Files\Java\jre1.8.0_20  [22:26:40] [main/INFO] [LaunchWrapper]: Loading tweak class name   cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker  [22:26:40] [main/INFO] [LaunchWrapper]: Loading tweak class name   cpw.mods.fml.common.launcher.FMLDeobfTweaker  [22:26:40] [main/INFO] [LaunchWrapper]: Calling tweak class   cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker  [22:26:40] [main/ERROR] [LaunchWrapper]: Unable to launch  java.util.ConcurrentModificationException     at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[?:1.8.0_20]     at java.util.ArrayList$Itr.remove(Unknown Source) ~[?:1.8.0_20]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:117) [launchwrapper-  1.9.jar:?]     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]  Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and   will likely be removed in a future release
97558
I've been trying to install the Java plugin for Chrome for a couple hours now, and I figured it was time to ask people with more experience. I can't seem to get it working. My current Java version is the 64-bit OpenJDK 1.6.0_24. I tried installing the IcedTea plugin to no avail. I have Ubuntu 12.04 64-bit installed at the moment.  When I tried testing if java was enabled in Chrome, any website with a Java applet would not load (when I disabled the plugin, they loaded, but not the applet).  I followed the instructions from here:   which said to create this script and run it:  JAVA_HOME=/usr/lib/jvm/jdk1.7.0 MOZILLA_HOME=~/.mozilla mkdir $MOZILLA_HOME/plugins ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so $MOZILLA_HOME/plugins   Note: You may need to change the value of JAVA_HOME so that it correctly points to your installation of the JDK. 64-bit users will need to change the final line to:   ln -s $JAVA_HOME/jre/lib/amd64/libnpjp2.so $MOZILLA_HOME/plugins   but this did not work as well.  I just test it in Firefox and it's working. Still nothing for Chrome
86158
I'm trying to install Netbeans on my Ubuntu. It was successfully installed but was unable to create new projects or new files. I have installed JDK 12 and then I removed it because I found here a solution that recommended removal of latest versions of JDK and set JDK 8 as default. I did what solution said but now I can't install JDK 8. It is showing me this error message:   E: Package 'oracle-java8-installer' has no installation candidate    So I started searching on the Internet about the solution and I found that "Oracle Java (JDK) 8 Installer PPA (DISCONTINUED)".   What should I do now?
81192
During development (and for debugging) it is very useful to run a Java class' public static void main(String[] argv)  method directly from inside Eclipse (using the Run As context menu).  Is there a similarily quick way to specify command line parameters for the run? What I do now is go to the "Run Dialog", click through the various settings to the tab where I can specify VM and program arguments and enter them there.  Too many steps, plus I do not want to mix the more permanent runtime configuration settings with the one-off invokation parameters. What I want instead is to check a box somewhere (or have a separate menu item "Run as Java application with command line") and then be prompted for the commandline every time (with a nice history).
27675
I uninstalled jdk packages and now can't install them back. I managed to install oracle-java7-installer and oracle-java8-installer but can't install oracle-java9-installer. It seems that my computer tries to download wrong version of oracle-java9-installer 177 when version i would be able to download is 178.    $ wget http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz --2017-07-21 11:00:02--  http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 200 OK Length: 293348142 (280M) [application/x-gzip] Saving to: 'jdk-9+178_linux-x64_bin.tar.gz'  jdk-9+178_linux-x64_bin.tar.gz     1%[&gt;                                                          ]   5.42M  5.04MB/s               ^C  $ wget http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz --2017-07-21 11:00:16--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 11:00:17 ERROR 404: Not Found.   Can you help? apt-get tries to install Oracle JDK 9.  I run Ubuntu 16.04 in virtual machine hosted by win7  Full error message:  sudo apt-get install oracle-java9-installer Reading package lists... Done Building dependency tree        Reading state information... Done oracle-java9-installer is already the newest version (9b177-1~webupd8~0). 0 upgraded, 0 newly installed, 0 to remove and 147 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up oracle-java9-installer (9b177-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk9-installer/wgetrc Downloading Oracle Java 9... --2017-07-21 10:54:11--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 10:54:13 ERROR 404: Not Found.  download failed Oracle JDK 9 is NOT installed. dpkg: error processing package oracle-java9-installer (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  oracle-java9-installerE: Sub-process /usr/bin/dpkg returned an error code (1)
61383
I didn't find any related articles about . There are some related articles but they didn't solve the problem.  I installed Oracle JDK tarball file from Oracle site by following this article . It was very helpful. But still I don't know what I should do in order to uninstall Oracle JDK.
82149
sachin@sachin-Lenovo-G550:~$ java -version java version “1.7.0_21″ OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1) OpenJDK Server VM (build 23.7-b01, mixed mode)   When I ran the above command this showed that Java is installed in my system, but when I am going to compile any Java program it gives the following error message:  sachin@sachin-Lenovo-G550:~/programs$ javac abc.java The program ‘javac’ can be found in the following packages: * default-jdk * ecj * gcj-4.6-jdk * gcj-4.7-jdk * openjdk-7-jdk * openjdk-6-jdk Try: sudo apt-get install   Please tell me how to get rid of it and run my Java program.
17086
I'm wondering something. Whenever i right click on minecraft and click open with another application, i try to find Java JDK. I have installed it for minecraft itself, but i just cant find where java is on the list of other applications. Any help?
47009
Java is one of my programming languages of choice.  I always run into the problem though of distributing my application to end-users.  Giving a user a JAR is not always as user friendly as I would like and using Java WebStart requires that I maintain a web server.  What's the best way to distribute a Java application?  What if the Java application needs to install artifacts to the user's computer?  Are there any good Java installation/packaging systems out there?
109620
I used   Runtime.getRuntime().exec("_____")   but it throws a IOException as below:  java.io.IOException: CreateProcess: c:/ error=5   at java.lang.Win32Process.create(Native Method)   at java.lang.Win32Process.&lt;init&gt;(Win32Process.java:63)   at java.lang.Runtime.execInternal(Native Method   I don't know whether I have the problem with specifying the path or something else. Can anyone please help me with the code.
22098
I'm deploying an apex class and Test class which is running successfully and covering 84% test coverage in sandbox however when deploying it in Prod, I'm running in to below issue. I have included Static Resource in the changeset. Any ideas what is wrong with it? The Static resource consist of a CSV file that includes User data (Name, email, Username , lastlogindate). istest public class TestScheduleInactiveUser {     @istest static void ScheduleInactiveUser(){              List&lt;sObject&gt; ls = Test.loadData(User.sObjectType, 'UserLoadTest');                          Test.startTest();             ScheduleInactiveUser fc=new ScheduleInactiveUser();             Database.executeBatch(fc);         Test.stopTest();              } }   Error: System.SObjectException: ORA-20001: ORA-06512: at &quot;DOC.CPROFILE&quot;, line 1128 ORA-01403: no data found ORA-06512: at &quot;DOC.CPROFILE&quot;, line 2940 ORA-06512: at line 1 SQLException while executing plsql statement: {?=call cProfile.get_user_type(?)}(00eP0000000bIq5)  Stack Trace:  Class.System.Test.loadData: line 53, column 1 Class.TestScheduleInactiveUser.ScheduleInactiveUser: line 5, column 1
9650
I followed all the instructions stated at this , but am encountering some problems with the last part of it.  I actually have version 6.22 of java and would like to update to version 6.30.  So after moving the extracted directory java-6-oracle into /usr/lib/jvm I do not know what to do, since the script that is pointed out in the answer above updates from java 5 to java 6.  For sake of clearness here is output if I do an ls in dir /usr/lib/jvm:  $ ls -l /usr/lib/jvm total 8  lrwxrwxrwx  1 root root   14 2011-07-12 15:18 default-java -&gt; java-6-openjdk lrwxrwxrwx  1 root root   14 2011-07-12 12:19 java-1.6.0-openjdk -&gt; java-6-openjdk  drwxr-xr-x 10 root root 4096 2012-04-12 12:06 java-6.31-oracle  drwxr-xr-x  7 root root 4096 2012-02-24 14:43 java-6-openjdk   What should I do now?    ADDED PART  Under the suggestion of @fossfreedom I ran the script anyway and actually it updated the java version.  In fact if I run command java -version output will be the following:  $ java -version java version "1.6.0_31" Java(TM) SE Runtime Environment (build 1.6.0_31-b04) Java HotSpot(TM) Server VM (build 20.6-b01, mixed mode)   There is still a problem, if Irun javac -version it gives me the old version installed:  $ javac -version javac 1.6.0_22   And if I use the tester at this  it will tell me that version is   Java Version 1.6.0_22 from Sun Microsystems Inc.   What's going wrong?  It seems that Java Runtime Environment has updated, but Java Compiler and Java plugin for browser have not.  How can I update them?    OTHER ADDED PART  sudo update-alternatives --config java will return following output  $ sudo update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin/java).    Selection    Path                                      Priority   Status ------------------------------------------------------------ * 0            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      auto mode   1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode   2            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      manual mode  Press enter to keep the current choice[*], or type selection number:   these makes sense with the fact that JRE is correctly updated to version 6.31, issues are on Java Compiler and Java browser plugin.  Any ideas?
29008
I have a computer that runs Debian Stretch which has Gstreamer 1.0 installed. I am trying to run a Processing sketch that uses the Processing video library which in turn relies on Gstreamer 0.10. This produces a runtime error because they removed a symbol gst_object_sink.  It seems a PITA to try to rebuild the Processing video library with different Java bindings for Gstreamer 1.0.  Thus the question: Is it possible to install on the same system a second version (0.10) of Gstreamer?    The problem seems to be that  appears in Wheezy, Jessie, SID, but not Stretch/Testing.... Why would that be, and how to fix it?