Question about Sun Java Programming Language (cdj-275)

3 Answers

Error to compile java program

When i comile the program using syntex ''javac filename.java'' in Dos
a message display on screen- 'JAVAC' is not recognized is as an internal or external command, operable program or batch file.

Please give me solution.

Posted by on

3 Answers

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Governor:

    An expert whose answer got voted for 20 times.

    Scholar:

    An expert who has written 20 answers of more than 400 characters.

  • Expert
  • 136 Answers

The main cause of this error is you havent set the environment variables correctly, you can do it as follows

Right click on "My Computers" select properties the click "Environment variables" then under "User variables for pcname"

select new and add the following paths

1)var name:path
var value:C:\Java\jdk1.5\bin

2)var name:classpath
var value:C:\YourJavaCodeDirName

click ok and its done

Posted on Jun 23, 2009

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Sergeant:

    An expert that has over 500 points.

  • Expert
  • 278 Answers

First off I assume you actually installed a JDK already before trying to compile the code. If not then you need to do that.

Secondly this error is because Windows cannot find the javac executable on your command. It could be because the JDK is missing or not installed or that Windows does not know where to look to find javac.exe from. You can simply run javac with the full path instead

ex.

"C:\Program Files (x86)\Java\jdk1.7\bin\javac" filename.java

Posted on Jan 30, 2015

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

U c dat u had given a proper path
C:\path=path of ur file

Posted on Mar 02, 2009

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Problems changing variables on windows 7 for Java jdk1.7.0. I have no path variable any ideas thankyou


If your trying to add javac.exe to your path variable do the following
  • Right Click Computer
  • Select Properties
  • On the left select Advanced System Settings
  • Select Environment Variables
  • Under System Variables scroll down to Path
  • Append the path and exe to the Path variable
If memory serves javac.exe is located in C:\Windows\System32 so append ;C:\Windows\System32\javac.exe

Comment if you need more help

Sep 13, 2011 | Sun Computers & Internet

1 Answer

Java Vitual Machine Launcher prompts this message "Could not find the main class. Program will exit" How can I solve this problem? I need urgent assistance.


You need to compile the .java file you have, and run the .class file that is produced.
Open up command prompt, go to your working directory. If your file was called Hello.java: In command prompt type "javac Hello.java". Now, in the working directory, you will see a new file, Hello.class. Run that file by "java Hello.class". Hope this helps!
Thanks for using FixYa

Aug 20, 2011 | Sun Java Programming Language (cdj-275)

1 Answer

Ple tell me how to run the "javac" command in my laptop iam already installed the 1 6 version of java, and I set path is "C:Program Files (x86)Javajre1.6.0_16in", "java" command is exetues but java c...


javac is the JavaCompiler, You've downloaded the Java Runtime. You need to download the SDK, which includes javac.
http://java.sun.com/javaee/downloads/index.jsp

Jan 24, 2010 | Sun Java System Web Server 6.1...

4 Answers

Java is not working


Hello there :
first you are going to want to ensure that your your current version of java is installed correctly and is not corrupted and if it needs to be reinstalled
download the latest java version and reinstall this . www.java.com
this should be able to take care of the problem that you are having ok?
best regards michael

Aug 23, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

1 Answer

Javac unable to compile java error or batch file?


first of all you have to set path for your jdk
have you done that???????

if not then go to youtube.com and search for that vedio.

if yes, then i think you have not named the project properly

when you are to save your project, name it in the "name of the main class.java"


for example:

class Manju
{
   public static void main(String arg[]s)
     {
       ___________________________;
       ___________________________;
     }
}

save it as Manju.java and then compile

no matter what other classes are being related to the project.

this much i only know

if you wanna contact me or chat with me, my email id is linushwahs@gmail.com

May 16, 2009 | Microsoft Windows XP Professional

4 Answers

Can anyone tell how run java program in cmd prompt???


Hi,

You need to type:

If it's a program.class

java program

or of it's a program.jar

java -jar program.jar

regards

Apr 03, 2009 | Sun Java Programming Language (cdj-275)

2 Answers

How to run java code in cmd prompt...


javac filename.java to compile and java filename to execute

Mar 21, 2009 | Computers & Internet

1 Answer

JAVAC IS NOT RECOGNIGED AS AN EXTERNAL OR INTERNAL COMMAND OPERABLE PROGRAM OR BATCH FILE''


Your PC - not the calculator - printed this message. It means that the PC tried to execute the Java compiler, but couldn't find the program. Either the Java compiler is not installed, or the PATH environment variable is not set correctly.
To install the Java compiler follow the instructions for installing J2SE at java.sun.com To fix the PATH environment variable: right-click on My Computer, select Properties, select Advanced System settings, select environment variables, edit or create a new variable called PATH in the system or user settings with the path of the javac.exe program. This is often found in c:Program FilesJavain (it's in a java...bin directory somewhere)

Mar 02, 2009 | Texas Instruments TI-83 Plus Calculator

1 Answer

Cannot install/uninstall Java


hi,
It is not necessary to install java in order to use java.
Just download java highest version, copy and paste the java software in the system drive(eg C:,D:,....), Then set path the java file.
Example, if you have the java file in your C drive, do the following steps

1. Goto start->Run-> type command. Command prompt(black screen) will open.
2. if it shows as C:> follow the steps, else Goto step 6.
3. set path="c:\Java file name"
4. type javac
5.after typing if u find compiler then Java is installed in your system.
6. Example... if it shows as F:> and if u have saved your file in C:, do the following.
7. cd..
8. cd..
9. cd C
10 .then it appears as C:>, follow from the step 3.

thank you.

May 07, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

Not finding what you are looking for?
Computers & Internet Logo

244 people viewed this question

Ask a Question

Usually answered in minutes!

Top Sun Computers & Internet Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18381 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Cosma Papouis
Cosma Papouis

Level 3 Expert

409 Answers

Are you a Sun Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...