 |
 |
Exception in thread "main" java.lang.NoClassDefFoundError
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2003
Status:
Offline
|
|
java error in mac os x.2.3 terminal.
I get this error "Exception in thread "main" java.lang.NoClassDefFoundError" when I try to run my *.class file under Terminal? What should I do?
I think I compile it correctly cause it pop up a *.class file with no error comment
i have a screenshot of the error @ <a href="http://www.sfu.ca/~jchungd/javaerror.jpg" </a>
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2003
Status:
Offline
|
|
the source code "import javax.swing.JOptionPane;
public class circle
{
public static void main(String[] args)
{
String input = JOptionPane.showInputDialog ("Please enter the radius");
double rad = Double.parseDouble(input);
double area = Math.PI*2*rad;
double cir = Math.PI*Math.pow(rad,2);
System.out.println("The area is " + area + ".");
System.out.println("The circumference is " + cir + ".");
}
}
"
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status:
Offline
|
|
You need to be in /Users/palm/Desktop/ because that's where circle.class is
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Or you can use java -cp /Users/jung/Desktop circle.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2003
Status:
Offline
|
|
It work! Thanks
I just need to be in the same directory as my *.java and *.class files.
BTW, is it possible to do C++ programming in a mac? can i still use Terminal? because in second year university we will be learning C, C++, and Java
and also How can I tell what version of Java in on my machine(10.2.3 / G4 MDD)? and Java on a Mac is the same as Sun's Java?
cause current Sun's Java version is 1.4.1_01
---------------------------
What programming language does Mac OS X or any Mac app (photoshop) use?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by pnz999:
BTW, is it possible to do C++ programming in a mac? can i still use Terminal? because in second year university we will be learning C, C++, and Java
Sure you can do C++ programming on the Mac. It uses the standard GNU tools, which include a C++ compiler. And yes, you can still use the Terminal. Though honestly it eludes me why you wouldn't want to use Project Builder's specialized interface.
and also How can I tell what version of Java in on my machine(10.2.3 / G4 MDD)? and Java on a Mac is the same as Sun's Java?
cause current Sun's Java version is 1.4.1_01
Type java -version to see the version of Java installed on your system. But I can already tell you it will be 1.3.1. Apple has had 1.4.1 in development for quite a while now. I don't expect it will be too much longer before they bring that out...but people have been saying that for months.
What programming language does Mac OS X or any Mac app (photoshop) use?
Whatever programming language the author feels like using. Photoshop, to my knowledge, is C++. OmniWeb is Objective-C. IOKit drivers are written in pure C. Limewire is Java. And many apps nobody seems to like are written in REALbasic.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2003
Status:
Offline
|
|
"And many apps nobody seems to like are written in REALbasic."
Whats wrong with REALbasic?
Project Builder, eh? My teacher recommend Codewarrior, it support both windows and mac, but its pretty expensive. Are all IDEs pretty much the same or not?
Project Builder is free and the lastest rev. is the Dec. 2002 version 2.1 right?
Does Project builder comes bundles with compiler that compiles C, C++, obj-C, obj-C++, perl, java? or is it a seperate download for compilers?
(Last edited by pnz999; Feb 1, 2003 at 09:00 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
PERL comes with OS X. All of the others you listed come w/ the developer tools. I wouldn't place too much faith in what that teacher has to say. Project Builder uses the gcc which has been ported to FAR more platforms than Codewarrior. You can get a Windows port of the gcc at http://www.cygwin.com
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: ~/
Status:
Offline
|
|
GCC may have been ported to more systems than Codewarrior but CW is a full IDE, GCC is just a compiler. Project Builder is ok for a free IDE but is really unlike many other IDEs you will run across programming on different platforms. Learning a language is great but you also need to learn to use the tools available, learning PB instead of CW is going to put you at a disadvantage anywhere that uses an IDE more similar to CW/VC++/Krylix.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Care to give an example as to what makes Project Builder so different than the IDEs you mentioned?
Project Builder and the IDEs you listed all offer an editor, a view of files in your project, a class hierarchy view, integrated help, and handle the compile and link phases for you.
The only features I can think of that Project Builder lacks are Intellisense(TM) and a bunch of goofy wizards. How exactly does not being familiar with these two features put you at a great disadvantage? How does knowing how to setup compile and link options in CodeWarrior help you when confronted with Visual Studio or Delphi/Kylix? Did the IDE vendors all submit to some standard that Apple missed out on?
CodeWarrior for Windows is a joke. If you're a professional software house that writes C/C++ code for Windows, you use Visual Studio. I believe it's actually carved in stone somewhere.
If you want to see an IDE "really unlike many other IDEs you will run across" check out IBM's VisualAge for Java or VisualAge for Smalltalk.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Status:
Offline
|
|
Thought I'd just give you my two peneth on your Java code :-)
Originally posted by pnz999:
the source code "import javax.swing.JOptionPane;
public class circle
You should give your class names a capital letter at the start, and make sure the .java file matches.
|
|
Nobody made a greater mistake than
he who did nothing because he could only
do a little. Edmund Burke
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|