Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Can't Compile Posted by Swingbash on 15 Feb 2005 at 7:16 AM
I have just started working through 'Teach yourself Java 2 in 21 Days', and I cannot compile the first program. I have tried de-installing and re-installing SDK 1.4.2_07 a number of times but that has not helped. I get the following error message:

'javac' is not recognized as an internal or external command.

I would appreciate any help.

Thanks.
Report
Re: paths Posted by arb123 on 15 Feb 2005 at 8:41 AM
: I have just started working through 'Teach yourself Java 2 in 21 Days', and I cannot compile the first program. I have tried de-installing and re-installing SDK 1.4.2_07 a number of times but that has not helped. I get the following error message:
:
: 'javac' is not recognized as an internal or external command.
:
: I would appreciate any help.
:
: Thanks.
:

See error explanations here:
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html

---------------------------------
HOWTO ask questions: http://catb.org/~esr/faqs/smart-questions.html

Report
Re: paths Posted by papu_c on 17 Feb 2005 at 12:27 PM
if using MS Win XP -go to my computer ,Enviornment variables and then
type the complete path of javac.exe file in the path section
Report
Re: paths Posted by pac on 18 Feb 2005 at 10:12 AM
: if using MS Win XP -go to my computer ,Enviornment variables and then
: type the complete path of javac.exe file in the path section
:
this is the JAVA_HOME in control panel, system, advanced and then env variables. It should be something like this depending on the way u installed it: c:\j2sdk1.4.2_05


Report
Re: paths Posted by Swingbash on 21 Feb 2005 at 10:15 AM
: if using MS Win XP -go to my computer ,Enviornment variables and then
: type the complete path of javac.exe file in the path section
:

Thanks. That was the problem. But now I have another problem. I have been running a number of programs from the book, but when I try to run an application with buttons using the pane.add(nameofbutton) command I get the following error:

at javax.swing.JFrame.addImpl(JFrame.java:491)
at java.awt.Container.add(Container.java:307)
at ButtonFrame.<init>(ButtonFrame.java:16)
at ButtonFrame.main(ButtonFrame.java:21)
Exception in thread "main"

Do you have any idea what is the problem.

Thanks
Report
Re: paths Posted by pac on 21 Feb 2005 at 12:41 PM
: : if using MS Win XP -go to my computer ,Enviornment variables and then
: : type the complete path of javac.exe file in the path section
: :
:
: Thanks. That was the problem. But now I have another problem. I have been running a number of programs from the book, but when I try to run an application with buttons using the pane.add(nameofbutton) command I get the following error:
:
: at javax.swing.JFrame.addImpl(JFrame.java:491)
: at java.awt.Container.add(Container.java:307)
: at ButtonFrame.<init>(ButtonFrame.java:16)
: at ButtonFrame.main(ButtonFrame.java:21)
: Exception in thread "main"
:
: Do you have any idea what is the problem.
:
: Thanks
:
Have you imported all the packages?
Report
Re: paths Posted by Swingbash on 21 Feb 2005 at 2:38 PM
: : : if using MS Win XP -go to my computer ,Enviornment variables and then
: : : type the complete path of javac.exe file in the path section
: : :
: :
: : Thanks. That was the problem. But now I have another problem. I have been running a number of programs from the book, but when I try to run an application with buttons using the pane.add(nameofbutton) command I get the following error:
: :
: : at javax.swing.JFrame.addImpl(JFrame.java:491)
: : at java.awt.Container.add(Container.java:307)
: : at ButtonFrame.<init>(ButtonFrame.java:16)
: : at ButtonFrame.main(ButtonFrame.java:21)
: : Exception in thread "main"
: :
: : Do you have any idea what is the problem.
: :
: : Thanks
: :
: Have you imported all the packages?
:
I downloaded all the SDK for 4.1.2_07. Is there extra software that I need to download?
Report
Re: paths Posted by pac on 22 Feb 2005 at 3:28 AM
: : : : if using MS Win XP -go to my computer ,Enviornment variables and then
: : : : type the complete path of javac.exe file in the path section
: : : :
: : :
: : : Thanks. That was the problem. But now I have another problem. I have been running a number of programs from the book, but when I try to run an application with buttons using the pane.add(nameofbutton) command I get the following error:
: : :
: : : at javax.swing.JFrame.addImpl(JFrame.java:491)
: : : at java.awt.Container.add(Container.java:307)
: : : at ButtonFrame.<init>(ButtonFrame.java:16)
: : : at ButtonFrame.main(ButtonFrame.java:21)
: : : Exception in thread "main"
: : :
: : : Do you have any idea what is the problem.
: : :
: : : Thanks
: : :
: : Have you imported all the packages?
: :
: I downloaded all the SDK for 4.1.2_07. Is there extra software that I need to download?
:

No, java needs to know what packages (Think thats what they are called) you are accessing - this means importing the packages.

If you are working from a book then you should see something like

import java.awt.*;

There are alot of different packages you can import so you will have to look into this further.

Report
Re: paths Posted by Swingbash on 24 Feb 2005 at 10:46 AM
: : : : : if using MS Win XP -go to my computer ,Enviornment variables and then
: : : : : type the complete path of javac.exe file in the path section
: : : : :
: : : :
: : : : Thanks. That was the problem. But now I have another problem. I have been running a number of programs from the book, but when I try to run an application with buttons using the pane.add(nameofbutton) command I get the following error:
: : : :
: : : : at javax.swing.JFrame.addImpl(JFrame.java:491)
: : : : at java.awt.Container.add(Container.java:307)
: : : : at ButtonFrame.<init>(ButtonFrame.java:16)
: : : : at ButtonFrame.main(ButtonFrame.java:21)
: : : : Exception in thread "main"
: : : :
: : : : Do you have any idea what is the problem.
: : : :
: : : : Thanks
: : : :
: : : Have you imported all the packages?
: : :
: : I downloaded all the SDK for 4.1.2_07. Is there extra software that I need to download?
: :
:
: No, java needs to know what packages (Think thats what they are called) you are accessing - this means importing the packages.
:
: If you are working from a book then you should see something like
:
: import java.awt.*;
:
: There are alot of different packages you can import so you will have to look into this further.
:
:

Report
Re: paths Posted by Swingbash on 24 Feb 2005 at 10:48 AM
: : : : : : if using MS Win XP -go to my computer ,Enviornment variables and then
: : : : : : type the complete path of javac.exe file in the path section
: : : : : :
: : : : :
: : : : : Thanks. That was the problem. But now I have another problem. I have been running a number of programs from the book, but when I try to run an application with buttons using the pane.add(nameofbutton) command I get the following error:
: : : : :
: : : : : at javax.swing.JFrame.addImpl(JFrame.java:491)
: : : : : at java.awt.Container.add(Container.java:307)
: : : : : at ButtonFrame.<init>(ButtonFrame.java:16)
: : : : : at ButtonFrame.main(ButtonFrame.java:21)
: : : : : Exception in thread "main"
: : : : :
: : : : : Do you have any idea what is the problem.
: : : : :
: : : : : Thanks
: : : : :
: : : : Have you imported all the packages?
: : : :
: : : I downloaded all the SDK for 4.1.2_07. Is there extra software that I need to download?
: : :
: :
: : No, java needs to know what packages (Think thats what they are called) you are accessing - this means importing the packages.
: :
: : If you are working from a book then you should see something like
: :
: : import java.awt.*;
: :
: : There are alot of different packages you can import so you will have to look into this further.
: :
: :
: Thanks, I found out what the problem was. In the line where I had
add.pane() I needed to have getContentPane().add.pane().

Thanks for your help.
:





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.