LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-14-2004, 03:19 PM   #1
darthczyz
Member
 
Registered: May 2003
Distribution: Redhat 9
Posts: 49

Rep: Reputation: 15
Java compiling question


Quick question about command line java compiling. I wrote a GUI from scratch using NetBeans. I tested it in NetBeans, and everything seemed to compile fine. However, when I tried to compile it on the command line, I got an error saying ClassNotFoundException: javax.swing.JFrame. I'm assuming I have to somehow add the libraries in to the command line compiler, but I don't know how to do that. Any help? Thanks
 
Old 01-14-2004, 03:34 PM   #2
luxitan
Member
 
Registered: Aug 2003
Location: Portugal
Distribution: Gentoo
Posts: 78

Rep: Reputation: 15
i guess you got to find out what imports are you doing that aren't in the standart library and then use the -classpath (or -cp don't remember) on the javac options
 
Old 01-14-2004, 03:40 PM   #3
darthczyz
Member
 
Registered: May 2003
Distribution: Redhat 9
Posts: 49

Original Poster
Rep: Reputation: 15
I'm an idiot. It actually compiles fine, but when I do:

java <file>

that's when I get that exception error. sorry. thanks for your help though
 
Old 01-14-2004, 03:42 PM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
you need to do "java classname" not "java classname.class" this confused me for hours before i found out
 
Old 01-14-2004, 03:46 PM   #5
darthczyz
Member
 
Registered: May 2003
Distribution: Redhat 9
Posts: 49

Original Poster
Rep: Reputation: 15
haha, yeah, that really is the worst error ever. unfortunately, that is not my error. i'm afraid that this is something trivial, like that other error. ugg ... thanks again though.
 
Old 01-14-2004, 04:12 PM   #6
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
You probably need to make sure your classpath is setup correctly. Either with the CLASSPATH environment variable or the classpath parameter for java. (-cp I think, or was that the classpath variable for javac, I never remember...)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling java chestud_it Programming 1 10-06-2004 01:30 PM
Compiling Java embalmedlenin Programming 3 08-28-2003 06:57 PM
java compiling problems LB9_B4Z Programming 7 05-02-2003 11:59 AM
compiling JAVA JIV Programming 8 03-28-2003 11:05 PM
Help compiling java gonus Linux - Software 4 08-05-2002 12:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration