Help! javac?

Hello!
I download j2re-1_4_0_01-windows-i586-i.exe then install but javac.exe is missing. I read in forum previous similar question but nothing. help me. thank you in advance.

Hello!
I download j2re-1_4_0_01-windows-i586-i.exe then
install but javac.exe is missing. I read in forum
previous similar question but nothing. help me. thank
you in advance.I may be mistaken, but I think that you need to have the jdk 1.4 installed. I don't think that the jre includes the compiler. I think it is only included with the jdk(sdk). So you will need to download the jdk/sdk.

Similar Messages

  • Javac -help:  'javac' not recognized...why?

    hi all,
    i just installed j2sdk1.4.0_02, but i have a problem. in the dos prompt, when i type C:\>javac -help, it results in a 'javac' is not recognized error. why?
    my PATH enviroment variable is this:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ActivCard\ActivCard Gold\resources;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\j2sdk1.4.0_02\bin\javac.exe
    what am i doing wrong?
    thanks,
    jeff

    Hi, I installe dthe sdk1.4.0 but have no
    C:\j2sdk1.4.0_02 dir (or anything relating to java).
    Did I not do something right? I can run the java
    command but not javac.If you don't have a directory similar to j2sdk1.4.0_02 then you did something wrong. You can try to search your system for javac.exe. If you post the exact steps you went through, someone here may be able to
    help you.

  • Help. javac keeps making more than 1 class with a $2 at the end.

    I'm taking my first Java class and I'm supposed to submit 1 class per assignment for my 2nd assignment, javac is making practiceB$2 and practiceB$3.
    here is the entire code
    import javax.swing.*;
    import java.awt.event.*;
    public class practiceB {
    JLabel label1;
    int i=1;
    public practiceB() {
    // Create a window.
    JFrame form1 = new JFrame("Main window");
    form1.setSize(300,120);
    form1.setVisible(true);
    JPanel panel1 = new JPanel();
    panel1.setLayout(null);
    form1.getContentPane().add(panel1);
    label1 = new JLabel("0");
    label1.setBounds(10,10,100,20);
    panel1.add(label1);
    // Create a button and add it to the form1.
    JButton button = new JButton("Click me");
    button.setBounds(80,50,150,25);
    panel1.add(button);
    // Add an event handler for button clicks.
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    label1.setText(e.getActionCommand() + " " + i);
    i++;
    // Make the form1 closable.
    form1.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public static void main(String[] args) {
    new practiceB();
    Even if I cut and paste the sample code I still get the same error
    Edited by: 806143 on Oct 28, 2010 4:47 PM

    806143 wrote:
    Sorry, I figured there might be something wrong. We have to do 5 "labs" per assignment practice A through E then submit the classes A through E.
    Submittal
    1. Upon complete all the learning activities, create a zip file named lab2.zip with only the following files in it.
     practiceA.class
     practiceB.class
     practiceC.class
     practiceD.class
     practiceE.class
    2. Upload the zipped file to Assignment 02 through Blackboard.
    That's why I was bit confused.I'll bet that since your putting all your *.class* files in a zip folder, it would probably mean these are the files which contain the<tt> main() </tt>method, and that there will probably be more files therein. Just as long as professor can launch your app with these files, I'm sure you're good to go OP.

  • Help, Javac comes up as "bad command"

    I installed j2rel1.4.0_03 - by default, it fell under program files->Java->j2rel1.4.0_03 . I tried javac under the dos prompt, and got "bad command". So I modified the path to this in my autoexec.bat:
    PATH=c:\windows;c:\windows\command;c:\ibmtools;c:\;c:\PROGRA~1\Java\j2re14~1.0_0\bin
    The command "java" is recognized, but "javac", even when issued from the bin subdirectory, still gets "bad command". I have spent a few hours on this already (and did the same when I tried on another pc 6 months or so ago). Is there some easier way of getting to first base that I am missing?
    G

    You might check to make sure the path is actually in the system path. Adding it to the autoexec.bat will only add it to the path when you restart. Type path at the prompt and make sure it is there. Also what os are you running. In winNT sometimes (depending on the configuration) the autoexec.bat does nothing, you might need to change autoconfig.nt, or just set it in the environment Variables. check if java -version works, this should let you know if it is set up right.

  • Javac error with classpath, but java works

    after setting class path, for example, i build a hello.java under c:\dev and i put it in the classpath,
    i goto c:\dev\ and typed javac hello.java, then i got hello.class, then i goto d:\
    and type java hello, it prints the string correctly, but if i type javac hello.java under d:\, it gave error: cannot read hello.java, but in the classpath, c:\dev is correctly set and commond java can run the hello.class from d:\, so why canot javac do the same.
    does that mean i have to go to the directory where the .java file is in to compile?

    It's true, class path only helps javac find other classes to include with your class. You must either compile in the source path, specify the source path in the file name or best choice, use ANT.

  • Importing .jar package

    How would I distribute a .jar package without installing it. I need this because the .jar is the mysql driver and I am not sure how to import it into my code (do I have to extract the files inside) or how to set the classpath I wish to use inside my code.
    Thanks in advance for the help.

    javac -jar TheJarFile.jar MainClass.java
    java -jar TheJarFile.jar MainClass
    I think from memory that's how it goes. Should work whether MainClass is in the Jar file or not.
    Cheers,
    Radish21
    (Or it might be javac -jar c:\storage\TheJarFile.jar MainClass.java, depends on where you put it)

  • Dynamic import

    I want to include packages or classes at runtime of the java.
    For example,
    i am unsing Date class means i dont give
    import java.util.Date;
    instead with in the class i need to import. How can i?
    - Muralidharan

    IIRC the import statement really just helps javac resolve the namespace.
    It doesn't actually add anything extra into your compiled class.
    But anyway it sounds as if perhaps what you're looking for is reflection.
    There are tutorials on this site about that. Search for "reflection" or check the tutorials link on your left.
    Reflection is a powerful tool but it can also be abused. My advice is to use it when you really need it, but be sure to confirm that you really need it and you can't get the effect you're looking for by improving your design.

  • Targeting earlier version of Java

    I have an application that is normally compiled in Java 1.4 (Customer need). We need to use a 3rd-party library that is compiled in Java 1.5. Is there any way we can compile our app in Java 1.5 and target 1.4 so it runs on the customers machine who only has Java 1.4 installed?

    Manual? Who needs one?
    javac --help
    javac: invalid flag: --help
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release>          Provide source compatibility with specified release
    -target <release>          Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system

  • I cann't execute javac with parameters. please help !!

    Hi All!!
    I can't understand how to execute application or bat file (javac.exe for example) WITH parameters correctly.
    I can execute javac.exe or bat file - WITHOUT parameters :
    Process p = Runtime.getRuntime().exec(WIN_PATH + " " + WIN_FLAG + " " + "javac.exe");
    But I can't execute correctly the command like:
    "javac.exe -classpath C:\Alex; Test.java"
    I tried to use exec(str,env[]) and exec(cmd[]) methods, but there were different errors as a result :(((
    How can I execute the command "javac.exe -classpath C:\Alex; Test.java" ? Is it possible?
    Please help me by a good idea.
    Thank you.

    right you are! That's why we use "\\" instead "\" :)
    If i try to execute this command -
    cmd=WIN_PATH + " " + WIN_FLAG + " " + "c:/j2sdk1.4.0/deleteMe/javac.exe -classpath C:/WORK/jboss-3.0.3/client/jboss-j2ee.jar;S:/Alexander/jars/sys.jar;S:/Alexander/jars/ejb_conf_dev.jar;S:/Alexander/jars/; C:/j2sdk1.4.0/deleteMe/aaBean.java";
    my OS Windows 2000 returns na error - "Error opening icon..."
    What's wrong?
    Thank you...

  • Need some help with javac

    Hi, I am having a little problem with java. When I try to compile code I have to type the whole path to
    where the javac compiler is.(by the way, I'm using linux)
    /usr/java/j2sdk1.4....you get the idea.
    I tried looking in the java tutorial and the box where it discusses this error the tell me to go to the
    installation page for linux. But their isn't anything there to help me out. It just discuses the installation
    process. Also, java runtime enviroment was installed when I installed linux so that would explain
    why I don't have to type in the path for 'java' too. How do I get around this problem?
    Thanks for any help.

    I don't know about linux, but in the new to java faq it talks about Solaris.
    http://access1.sun.com/FAQSets/newtojavatechfaq.html#4

  • Truble with javac please help

    i am having alittle truble i can't use javac on my computer and i was looking at other forums and and thay said to add these 2. but i don't now where and what path to do it in. please help me
    C:\foo\bar\> set PATH=%PATH%;C:\j2sdk1.4.2_01\bin
    C:\foo\bar\> javac Filename.java

    [The Java Tutorials|http://java.sun.com/docs/books/tutorial/]
    [Getting Started|http://java.sun.com/docs/books/tutorial/getStarted/index.html]
    [The "Hello World!" Application|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html]
    ["Hello World!" for MS Windows|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html]

  • Pls help me with the running of javac!!!

    Thanks for taking a look.
    I am a student just finished install the JDK1.2.1 version. The steps i have done below to get the error.
    -At the c: prompt, set path=c:\jdk1.2.1\bin
    -cd temp (access my working folder)
    -At c: prompt, i type javac Hello_Java.java (Hello_Java.java is my starting program)
    What i get is an illegal operation : JAVAC caused an exception e06d7363H in module MSVCRT.DLL at
    017f:78008d93
    EAX=00000003 CS=017f EIP=78008d93 EFLGS=00000206
    EBX=ff02000f SS=0187 ESP=0063e798 EBP=ff01ffff
    ECX=00000001 DS=0187 ESI=78036328 FS=4747
    EDX=e06d7363 ES=0187 EDI=0063e7c0 GS=0000
    Bytes at CS:EIP:
    e9 03 6f 00 00 55 8b ec 83 ec 04 53 56 57 fc 89
    Stack dump:
    0000000f 05500044 e06d7363 00000001 00000000 00000000 00000003 19930520 0063e7d4 503f0cf0 503b2ce2 0063e7d4 503f0cf0 503f279c 00000001 503f279c
    I have try re-installing it but to no avail. I am using Windows 98.
    Thanks in advance for any help.

    Straight from www.sun.com Java j2SDK docs..
    Set the PATH variable if you want to be able to conveniently run the Java 2 SDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command. If you don't set the PATH variable, you need to specify the full path to the executable every time you run it, such as:
    C:> \jdk1.3.1_<version number>\bin\javac MyClass.java
    It's useful to set the PATH permanently so it will persist after rebooting.
    Now setting the path in Windows 98
    1. Start the system editor. Choose "Start", "Run" and enter sysedit, then click OK. The system editor starts up with several windows showing. Go to the window that is displaying AUTOEXEC.BAT.
    2. Look for the PATH statement. (If you don't have one, add one.) If you're not sure where to add the path, add it to the right end of the PATH. For example, in the following PATH statement, we have added the bin directory at the right end:
    PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1_<version number>\BIN
    Capitalization doesn't matter. The PATH can be a series of directories separated by semi-colons (;). Microsoft Windows searches for programs in the PATH directories in order, from left to right. You should only have one bin directory for a Java SDK in the path at a time (those following the first are ignored), so if one is already present, you can update it to jdk1.3.1_<version number>.
    3. To make the path take effect in the current Command Prompt window, execute the following:
    C:> c:\autoexec.bat
    To find out the current value of your PATH, to see if it took effect, at the command prompt, type:
    C:> path

  • Help! I can't run javac............

    I just install WinME for my pc! However, the method to set path in WinME is different with Win98! I set the path in Win98 by using 'sysedit', however, WinME haven't got 'sysedit', then i tried to set path in 'msconfig'! But, it only allows us to set one path, how should i add one more paths?
    i can't run javac, it said msvcrt.dll has problem!
    what happen?
    I can set path in Win98 but winME is different.
    thank you

    Windows ME - To set the PATH permanently:
    From the start menu, choose programs, accessories, system tools, and system information. This brings up a window titled "Microsoft Help and Support". From here, choose the tools menu, then select the system configuration utility. Click the environment tab, select PATH and press the edit button. Now add the SDK ( e.g C:\j2sdk1.4.0-beta3\bin)to your path by Looking for the PATH statement. (If you don't have one, add one.) If you're not sure where to add the path, add it to the right end of the PATH.
    After you've added the location of the SDK to your PATH, save the changes and reboot your machine when prompted.
    hope this help

  • HELP Unable to find a javac compiler

    Hi I try to show a report maked in CrystalReports11 and i try to view y a jsp page but the next error apears:
    Estado HTTP 500 -
    type Informe de Excepci�n
    mensaje
    descripci�n El servidor encontr� un error interno () que hizo que no pudiera rellenar este requerimiento.
    excepci�n
    org.apache.jasper.JasperException: No se puede compilar la clase para JSP
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    causa ra�z
    Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK
         org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
         org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
         org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Somebody help me or any know how view a report in Jbuilder but not in jsp?? thanks!

    Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.Ensure that the tools.jar from the JDK is part of your classpath

  • Help with displaying output of javac

    Hi, I got some code from this forum that helped me
    to implement buttons with Action for compiling java code. Any output or exception generated can be displayed to JTextArea.
    However, just found out the code I got hangs in cases
    when there seems to be lots of exception in source code. (i.e. Nothing displayed on JTextArea )
    I list the code below, can someone tell me what I need to do to display output in JTextArea properly??
    /* Usage
    java OutputCapture javac MyClass.java
    java OutputCapture java MyClass
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    public class OutputCapture {
    public static void main(String[] args)
    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    JTextArea tArea = new JTextArea("",8,20);
    tArea.setLineWrap(true);
    tArea.setWrapStyleWord(true);
    JScrollPane pane = new JScrollPane(tArea);
    panel.add(pane);
    frame.getContentPane().add(panel);
    frame.setSize(300,300);
    frame.setVisible(true);
    String runString = "c:\\java\\bin\\"+ args[0]+ ".exe " + args[1] + "";
    String output;
    try
    Process p = Runtime.getRuntime().exec(runString);
    Vector streams = new Vector();
    streams.addElement(p.getInputStream());
    streams.addElement(p.getErrorStream());
    BufferedReader reader = new BufferedReader(new InputStreamReader(new SequenceInputStream(streams.elements())));
    while ((output = reader.readLine()) != null)
    tArea.append(output + "\n");
    reader.close();
    catch(Exception e) { e.printStackTrace(); }
    </pre>
    * Can someone please list the code for displaying
    output of compiling/runnning app with Runtime.exe()
    command in JTextArea properly? (this is driving me
    nut)
    Thanks
    Okidoki

    Hi
    I tried your code and it still doesn't work.
    It simple hangs there now without output to
    screen. Can you be more specific? I have
    provided your code below and a class with
    bug to be compiled by your code.
    Can you show me how the output of compiling can
    be shown to screen or to a file through
    your method?
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class Exec {
         public Exec(String app) throws Exception {
              Process process = null;
              //final OutputStream out;
              final InputStream err, out;
              process = Runtime.getRuntime().exec(app);
              //out = process.getOutputStream();
              out = process.getInputStream();
              err = process.getErrorStream();
              Runnable r = new Runnable() {
                   public void run() {
                        Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
                        try {
                             while(true) {
                                  int i = out.available();
                                  int j = err.available();
                                  if(i > 0) {
                                       byte[] b = new byte;
                                       out.read(b);
                                       //System.err.write(b);
                                       System.err.println(b);
                                  if (j > 0) {
                                       byte[] b = new byte[j];
                                       err.read(b);
                                       //System.err.write(b);
                                       System.err.println(b);
                             } // while
                        } catch (IOException e) {
                             System.err.println(e);     
              new Thread(r).start();
              process.destroy();
         public static void main(String[] args) {
              try {
                   //String s = "c:\\JBuilder5\\jdk1.3\\bin\\javac.exe FontColorDialog.java";
                   String s = "c:\\JBuilder5\\jdk1.3\\bin\\javac.exe test2.java";
                   new Exec(s);
              } catch (Exception e) {
                   System.err.println(e);
    //==================================
    // Testing class
    //import javax.swing.*; // Uncommented here on purpose
    public class test2 {
         public static void main( String args[] ) {
              System.out.println("Hello World!");
              JTextField jtf = new JTextField();
              System.out.println("Font: " + jtf.getFont().toString() );
    Thanks

  • Unable to javac programs with Windows ME! Help!

    Help! I can't find a solution for this problem anywhere on Sun's website. I know others have had this problem, yet none of the comments I found work.
    I'm simply trying to javac a simply program from within a MS-DOS window, but I get the error message "THIS PROGRAM CANNOT BE RUN IN DOS MODE". My path variable is set correctly (to C:\WINDOWS;C:\WINDOWS\COMMAND;C:\J2SDK1.4.1\BIN) AND the "Prevent MS-DOS-based programs from detecting Windows" box is UNchecked. I've restarted my computer and I still have the same problem.
    I'm starting to think I should just stick with VB. If you live in the Denver area, I'll even pay you to help me out with this problem.
    Thanks for lending your time!

    Hey, Thanks for helping out! I've downloaded textpad,
    and I do like the color-coded format and the easy
    access to commands. Once I opened up a text file
    program and tried to javac it (via the tools menu) I
    received a dialog box "The system cannot find the file
    specified". The header of that dialog box was
    "C:\Windows\javac.exe". I'm guessing it's looking in
    the wrong place dispite the fact that my path is
    "C:\WINDOWS;C:\WINDOWS\COMMAND;C:\J2SDK1.4.1\BIN".
    Thoughts on what I'm missing?
    Thanks again!Hum...that�s strange TextPad has always worked for me.
    And I have been using TextPad since version 3.5 and JDK 1.2
    First you could try copying the files to c:\windows\
    Or you could download JavaOne aka Forte4Java
    But tats a heavy load on the system if you have a slow computer it has its own compiler but I haven't been able to run applications with Forte....Only applets.
    http://wwws.sun.com/software/sundev/index.html
    Get Community edition (CE)
    If none of that works then
    Get Win 98 SE or Win 2000
    I my selfe run Win 2000 very good OS

Maybe you are looking for