Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 04 May 2012 09:11:51 -0500 From: Leif Roar Moldskred Subject: Re: my java is broken ! Newsgroups: comp.lang.java.programmer References: <15508526.29.1336086347980.JavaMail.geo-discussion-forums@ynjj16> User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (Linux/3.0.0-17-generic-pae (i686)) Message-ID: Date: Fri, 04 May 2012 09:11:51 -0500 Lines: 39 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-0o8DuV+/5rBD695tA8kn9MFs3u/2EyB006igvy6m6OyBZ2djB8/wC43zW9PwCcFf1+0NywXI4pFRUof!ABGr0gwjsk0reCTOU3DXNsB8Q9oT6AQlcdDasCU4FRU9hAbX47QA1Lfls/0MwYurU8UuLOCcJA== X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2689 Xref: csiph.com comp.lang.java.programmer:14262 bilsch wrote: > > Programs java and javac are in directory: /home/bilsch/jdk7/bin/ > Offending program, Nvr1.java is in directory: > > /home/bilsch/NetBeansProjects/NVRAM/src/ > > environment variable PATH is: > > /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games And there's your problem -- your PATH does not contain the directory your java and javac commands are found in, neither as an explicit entry of /home/bilsch/jdk7/bin/ or implicitly through the current directory . > However note that when I run; java Nvr1.class (or simply Nvr1) from my > home directory the output errors are in javanese, as follows: > > bilsch@p4pwj:~/jdk7/bin$ java Nvr1 > Exception in thread "main" java.lang.NoClassDefFoundError: Nvr1 > Caused by: java.lang.ClassNotFoundException: Nvr1 You're running a java command here, but not the one at /home/bilsch/jdk7/bin/java -- you must have another java command in your system somewhere. (Try the command "which java" to show where the java command that's actually being run is.) The solution is to add the directory /home/bilsch/jdk7/bin/ to the front of your PATH. Write the following command on the command line: export PATH=/home/bilsch/jdk7/bin/:$PATH You should then be able to call javac, use that to create a .class file and then use java to run the class file. -- Leif Roar Moldskred