• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

NoClassDefError...

I switched from Computer Engineering, to computer science after I found out how much I like programming last semester in college.

Now I am in an Entry Level Java class much to my dismay.

The program they chose to use is BlueJ-- and it is quite possibly the most inane/stupid program I have ever used. It has almost completely gotten rid of anything text based.

Next, we have to write this weird code that runs our program and asks us if the output was correct. That's right, we have to write a second program that merely asks us if the first one is right.

Finally, we have to submit to this thing called WebCAT-- where if BlueJ is inane, this is something beyond that by a lot. It is an electronic grader for programs. To show how inane it is, 5 minutes of code (And I have impeccable formatting when writing programs) took me an hour and a half. I got docked a point for forgetting a period on comments.

Has anyone else had to suffer through any of this in their pursuit of a CS or similar degree??

-Kevin

Edit: How do I fix the "NoClassDefError". I downloaded the JDK from the Multiverse repository on linux and i updated the preferences to use that instead of GIJ. Is there something else I need to do?
 
BlueJ blows. The first java class I took at UT required us to use it for our assignments, I ended up doing all my work in emacs and then just making sure it worked in BlueJ before submitting it. BlueJ simply sucks, that's all there is to it.
 
WOO!! I asked him after class if I could use a Linux command prompt based compiler instead and he said to make sure that I imported the class files but that he doesn't mind if I do.

Ok now can someone recommend to me a Linux based command line compiler? From my limited experience in command line based via C++, I understand that I make a .txt file and then execute build and compile commands on it with a compiler.

-Kevin

Edit: Thats what I thought. I saw that he had to execute each object independently in order or something. In addition whatever testing function they were pushing us to use annoyed the CRAP out of me!
 
just go to sun's web site and download the linux version of JDK SE6. they also have a windows cli version too(thats what I usually use) to compile it is just the javac command - In windows (sure you can set it up in linux text editors) using crimson edit or textpad plus it was easy enough to set it up to compile from there too, but sometimes you have to use the command line. Or you can use the command line every time if you want
 
Well let me ask this-- which would be most useful for future jobs. I plan on applying for an internship with the CIA, NSA, DoD or something similar. Would they typically use command line based like in linux or would they use an IDE like Visual Studio?

-Kevin
 
cant give you an definite answer but will tell you most places probably use an IDE. The two popular java ide's are Eclipse and Netbeans - netbeans is from sun but is most likely less popular than Eclipse. My belief is that is better to learn it the hard way - cli compiling and just a text editor - as that way you get a good understanding of the language that way. If you learn the language using an IDE you risk missing some parts of how the language fits together.

Both Eclipse and Netbeans are free
 
Excellent, I am most interested in learning the language thoroughly as I go through it. I'll be installing Ubuntu on my Tablet PC (Toshiba M400) soon so that both computers (Already use it on my Desktop) use it.

Is there a site you can recommend where it can give me a run down of the console commands I need to memorize in order to use the command line based compiler.

I already have something for C++ (GCC? Maybe?) and I am not 100% sure how to work it. I have the txt file written with a very basic hello world program. From the CLI what are the commands/syntax to get it to work.

I do not have the JDK (Which I assume is what I will need to download) for Java. Will the same commands work that I would use above to compile and run this code?

-Kevin
 
It's going to depend widely on the type of project that you would work on, and even personal preference too depending on the project.

You wouldn't use VS to write a Java program anyways, you would use VS to write a Windows program and then whatever tool needed to write your Java project.
 
Originally posted by: Crusty
It's going to depend widely on the type of project that you would work on, and even personal preference too depending on the project.

You wouldn't use VS to write a Java program anyways, you would use VS to write a Windows program and then whatever tool needed to write your Java project.

Well yea-- I know we used Visual Studio to write C++ last year and I was merely using it as an example of an IDE.

This is, yet another, entry level programming class. I just want to make as much out of the course as I can.
 
only 3 commands you need to know for java and the command line

java - runs your application

javac - compiles your class files

jar - makes java archive - you probably wont study these till later in the class or the next java class

there is one or two others for making applets and javadocs but cant remember them atm


edit - Sun has good tutorials on their site along with the API. The command line parts for java are real easy - just get the latest developers kit - JDK 6SE - I find sun's website relatively well laid out for figuring out what you need and to get the help you need.

The API I mention you may want to start looking at - it tells you everything you could ever want to know about java commands and methods but can be overwhelming at first - so look at it slowly and as you learn the language it will make more sense
 
Lots of good comments already, but I just wanted to say that even if you want to do some CLI compilation, you should still probably get used to using Eclipse. It seems like every Java developer I know uses it.
 
Originally posted by: Crusty
BlueJ blows. The first java class I took at UT required us to use it for our assignments, I ended up doing all my work in emacs and then just making sure it worked in BlueJ before submitting it. BlueJ simply sucks, that's all there is to it.

Agreed, I remember my intro to Java class at UT using BlueJ, don't know why since every other class afterwards used eclipse...
 
Well the professor said that as long as I imported all the class files that he didn't have a problem using an CLI Based compiler. I'm going to try eclipse real quick, but seeing as I will be taking a UNIX course next semester, I really want to start migrating more and more programs and tasks over to my Linux partition.

-Kevin
 
Originally posted by: Gamingphreek
Well let me ask this-- which would be most useful for future jobs. I plan on applying for an internship with the CIA, NSA, DoD or something similar. Would they typically use command line based like in linux or would they use an IDE like Visual Studio?

-Kevin

I dunno about the gov, but I'm an intern for Lockheed Martin, and we use Eclipse. The code is generally managed via a Unix CVS server.

In any case, Eclipse is a very versatile and powerful IDE, also (as mentioned) pretty popular in general. It'd be useful to learn it. That way when something doesn't work, you know for a fact that it's not Eclipse (ie: you don't have to re-load the CVS code multiple times to test config settings 😉 )
 
Originally posted by: Gamingphreek
Well let me ask this-- which would be most useful for future jobs. I plan on applying for an internship with the CIA, NSA, DoD or something similar. Would they typically use command line based like in linux or would they use an IDE like Visual Studio?

-Kevin

I worked for the federal government. We used RAD (Eclipse) for Java development and ClearCase for SCM.
 
Originally posted by: Gamingphreek
Well let me ask this-- which would be most useful for future jobs. I plan on applying for an internship with the CIA, NSA, DoD or something similar. Would they typically use command line based like in linux or would they use an IDE like Visual Studio?

-Kevin
Another common way to do it is ant scripts. Ant is roughly to java what make is to c. You write a sort of cross between a script and a configuration file that controls how your project is built/deployed/tested/packaged or whatever else you could possibly want to automate. Eclipse and netbeans will both integrate with it nicely, but of course you can always build from the command line.
 
I would def stick to Eclipse or Netbeans. Sticking to a CLI and notepad is pretty silly, and although it shows you how everything works together, thats something you can figure out on your own in 2 minutes.

I am actually writing part of a plugin for eclipse that integrates it with sourceforge for my senior project. Its funny that you bring up Webcat, because another group is also incorporating Webcat into the plugin. (My school is heavily project based, and we use a school run sourceforge site a lot)
 
How do I fix the "NoClassDefError". I downloaded the JDK from the Multiverse repository on linux and i updated the preferences to use that instead of GIJ. Is there something else I need to do?

I'll have Netbeans in as a back up I think (I'm torn between that and Eclipse), but I also want the ability to do CLI Coding.

-Kevin
 
NoClassDefFoundError is a signal that java cannot find a particular class it is looking for. This is almost always an issue with a dependent jar file or something missing from your classpath. Or else sometimes you think you have the correct library that contains the class you need but in actuality you don't and the class you think is in the jar file really isn't. Anyway, check your classpath. Usually the error will tell you which class it was looking for that it could not find. What is it in your case?

When using IDE's to do development and debugging you have to keep in mind that you have 2 classpaths you need to consider. One is your build time classpath and the other is your runtime classpath. If your code is compiling but then you get this NoClassDefFoundError when you try to run it, the problem is with your runtime classpath. If your code won't compile you have a problem with your build classpath.
 
do you have more than one class file? if you are compiling them from the cli you need to do them in the proper order. You need to compile the one that doesnt depend on or call another class first, then the one that calls that class - is that your case?
 
Originally posted by: Gamingphreek
How do I fix the "NoClassDefError".
the NoClassDefError? Waayy more details are needed. Are you trying to run a hello world? What java/class files do you have, what directory are you in and what commands did you run to compile or run your program?
 
Back
Top