This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Errors getting set up - New Guy

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all! I decided to learn Java and, being new, I installed NetBeans (WindowsXP system) first and, then, as part of reading more about Java I found this site. I found the College and began working on the main page to make sure all worked.

I had path issues when I tried to compile the code on the page (the HelloWorld app) but corrected that. My problem now is running the app. I get this error: exception in thread "main" java.lang.NoClassDefFoundError. I have searched the web and have determined it seems to be related to the CLASSPATH. I have tried various approaches I found to solve this but have had little luck.

Does the classpath go to the folder the apps I make are in (in this case that would be the C:\java folder I made, following the ideas on the Cattle Drive page)? Or does it got to where the jdk is set up?

Or am I better off to uninstall NetBeans? Everything works beautifully through NetBeans. I typed the code in Notepad, saved it, opened it in NetBeans and everything works. I just want to do it right

Oh, is it OK for a newbie to Java to start this course? I do have some programming experience but not in Java.

[ December 05, 2008: Message edited by: John Kirchner ]
[ December 05, 2008: Message edited by: John Kirchner ]
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Kirchner:
Does the classpath go to the folder the apps I make are in (in this case that would be the C:\java folder I made, following the ideas on the Cattle Drive page)? Or does it got to where the jdk is set up?


The classpath needs to point to where your apps are ... The jdk classes are automatically included when you type
java HelloWorld
(Note that is is not
java HelloWorld.java or java HelloWorld.class)

Also, remember to put the dot at the beginning of the classpath.

Or am I better off to uninstall NetBeans? Everything works beautifully through NetBeans. I typed the code in Notepad, saved it, opened it in NetBeans and everything works. I just want to do it right

I think you don't need to uninstall NetBeans, however, I would ignore it at least until you get it working without NetBeans so that you understand what is happening and you don't need to depend on the IDE to handle all that for you... you'll need to know it sooner or later and, in my opinion, sooner (and with simpler apps) is better.

Oh, is it OK for a newbie to Java to start this course?

Absolutely!!
 
John Kirchner
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help! I actually found the problem. The devil is in the details I guess. I carefully reread the Cattle Drive page and realized that, though I had updated my path to include the sdk, I never included the path to the JRE. I added this little bit in "C:\Program Files\Java\jdk1.6.0_11\jre\bin" and it runs like it should.

I did uninstall NetBeans though. I really just like a text editor. I always use VI on my Linux box...just old school I guess.

So, off to read the chapters and get the rest set up. I am really looking forward to learning Java.
 
village idiot
Posts: 1207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome, John! You'll be glad you found the ranch and decided to do the drive. When you get your first assignment submitted for nit-picking, post it in the assignment log thread, and when I get back home I'll add you to the student list. (I'll be home on the 17th!) I could try to add you manually from here, but I'd probably screw something up........
 
Sheriff
Posts: 1367
18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome!

I work as a developer, and am still using vi as my editor. I just never got into any IDE.

Works for me
 
John Kirchner
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the welcomes, I appreciate it.

Carol, I have not fully signed up yet. I have gotten the book and have started reading/practising but I have to get Christmas sorted and such before I can get the tuition together.

As a side note, I really appreciate the forums here. I had problems with my work laptop and getting java to work correctly. After some hunting here, I found it was the java files that oracle installs. Their paths were conflicting. I found the solutions and hints to the source of the problem here.
 
Katrina Owen
Sheriff
Posts: 1367
18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eh, I hear you... These forums have been a life saver for me!
 
Carol Murphy
village idiot
Posts: 1207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This site is a gold mine, imho.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!