JDK 6 SE not working

My code is correct and I have a .class extension for each successful source code file. However, when I try to compile a successful application such as javac AccountTest.java, the command prompt says that 'javac' is not recognized as an internal or external command, operable program or batch file. I think the problem has to do with the environment variables, specifically CLASSPATH and PATH. But, I don't know how to fix it.
I can find where I saved JDK by going to start,my computer, Local Disk (C:), and then to the "Java" folder where the JDK is saved.
My Classpath environment variable = C:\program files\java\jdk1.6.0_01\lib\tools.jar;
My Path environment variable = C:\Java\jdk1.6.0_01\bin; C:\windows\system;
Please help!

I recommend following Paul's recommendation of trying to run javac directly from the directory in which you can see it (the bin directory of your JDK installation).
How do you have .class files if you have not been able to run javac? The javac compiler is used to compile .java source code files into .class files.
The message you are seeing is definitely indicative of a Path problem rather than a CLASSPATH problem. You can see this by typing "thisIsJunk" on your DOS command-line to see the same message. It has nothing to do with Java in particular, but has to do with the JDK bin directory being appropriately added to your path. However, that being stated, why are you pointing your path at C:\Java when it appears (from your CLASSPATH variable) that you have Java installed at the default location of C:\Program Files\Java\jdk1.6.0_01? Having different environment variables pointing at different installations of even the same version of Java can be troublesome down the road, so I suggest you have your Path point to the bin directory at (C:\Program Files\Java\jdk1.6.0_01\bin). I typically define a JAVA_HOME (because many tools such as Ant look for this) in the following manner:
JAVA_HOME as C:\Program Files\Java\jdk1.6.0_06 (use your version instead of mine)
Then, I place Java in the Path like this:
%JAVA_HOME%\bin (and I put it very first in the Path)
The advantage of this is that when I upgrade Java in the future, I only have to change the JAVA_HOME setting and the Path gets updated automatically.

Similar Messages

  • Why Oracle 8i is not Working with JDK 1.3

    Why Oracle 8i is not Working with JDK 1.3 by using JDBC.

    try this
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:"somedsn","scott","tiger");
    I am using this for Oracle, it is working for me.
    Uma
    Java Developer
    http://www.globalleafs.com

  • Java JDK not working.

    Hello! I would like to program in Java on my new Arch Linux machine, but it doesn't seem to work. When I use the terminal javac works fine and compiles the file, but when I try running it with java, it does not work. Also, when one class calls another, javac ignores the fact that both files are in the same folder, and just gives errors. Please help!
    Thank you!

    Hm, sorry I have no idea then.
    I just made a minimal test with 3 classes myself but can't reproduce the problem.
    These are the JDK packages I have installed:
    $ yaourt -Qs jdk
    extra/jdk7-openjdk 7.b147_2.1-3
    Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - SDK
    extra/jre7-openjdk 7.b147_2.1-3
    Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs -Full Java runtime
    environment - needed for executing Java GUI and Webstart programs
    extra/jre7-openjdk-headless 7.b147_2.1-3
    Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - Minimal Java
    runtime - needed for executing non GUI Java programs

  • Tomcat 4.1.x not working under JDK 1.2.2

    We are trying to test our web application on all versions of JDK starting from 1.2.2. We use Tomcat as the servlet engine and after upgrading from Tomcat 3.2.x to 4.1.24 (we've tried 4.1.18 as well) we have noticed that the new Tomcat does not start under JDK 1.2.2, see command line output below. We've tried on several machines and it fails with the same Exception. Has anyone tried running Tomcat 4.x on JDK 1.2.x? We find it hard to believe that a product like Tomcat would fail to support JDK 1.2, so any information would be appreciated.
    C:\Java\jakarta-tomcat-4.1.24\bin>catalina.bat run
    Using CATALINA_BASE: ..
    Using CATALINA_HOME: ..
    Using CATALINA_TMPDIR: ..\temp
    Using JAVA_HOME: c:\java\jdk1.2
    Bootstrap: Class loader creation threw exception
    java.lang.IllegalMonitorStateException: current thread not owner
    at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java, Compiled Code)
    at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.java, Compiled Code)
    at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java, Compiled Code)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java, Compiled Code)

    I had the same problem.
    No Tomcat 4.1.x is not working under JDK1.2.2.
    It has something to do with a difference in byte code of the classes between jdk1.2.2 and jdk 1.4.
    I am running now on J2SDK1.4.1_03 and have no problems any more

  • MessageFormat with arguments not working in jdk 6

    I cant get the date to be formatted when using Jdk 6. Has something changed? Or am i using it in a non-standard way that gives this error.
    I have run this test in Jdk 1.5.0_10 and 1.6.0_02.
    And it fails in the 1.6.0_02.
    This is a JUnit 4 testcase.
    import java.text.MessageFormat;
    import java.util.Date;
    import java.util.Locale;
    import org.junit.Test;
    * This test the MessageFormat for usage.
    * A bug in jdk 1.6.0 seams to be the problem.
    * @author robert.alexandersson
    public class LanguageJDKVerificationTest {
         private static long time = 1000555500115L;
         @Test
         public void formatDate(){
              String formatString = "Date {0}";
              Date date = new Date();
              date.setTime(time);
              Object[] args = new Object[]{date};
              Locale locale = new Locale("sv_se");
              MessageFormat format = new MessageFormat(formatString, locale);       
             String formatted = format.format(args);                
             assertEquals(formatted, "Date 2001-09-15 14:05");
    }

    Hi there and thanx for answering.
    I researched a little more.
    The problem seams to be that the JDK 6 does not support sv_se as an input for langauge.
    BUT, the older JDK:s (1.4 or 5) did this.
    I would consider this as a backwards compatablility bug. They(SUN API:s) never said it would work with sv_se but it did anyway.
    It does however not seem to be the Locale that handles this different so its propably the DateFormat that is somehow different in its implementation.
    The sv_se is the "programmatic" version of the Locale, and this might be why it worked earlier on.

  • JDK 7 + Red Hat 6 64-bit = WLS 10.3.6 and WLS 12.1 installer not working

    Hi,
    I have installed Weblogic 10.3.6 and 12.1 on two different Red Hat 6 64-bit servers. I started out using JDK 7 (1.7.0_05) but when I reached the screen where you select which products to install I could not select or deselect anything with the mouse. On others I could not use the keyboard for input. As soon as I switched to JDK 6 everything worked fine.
    As a workaround I installed and configured everything with JDK 6 and switched to JDK 7. This works fine and the developers are happy.
    But I have discovered that the I have the same problem when I use config.sh, so it is general problem with the GUI and JDK 7.
    I opened a Service Request on MOS in June but I don't think the support guy has much of a clue. He has been testing with Windows. His last suggestion was running the installer with -d64, but according to the manual this should only be used when using a 32/64-bit hybrid JDK, which is not the case.
    Anybody has any ideas?
    Regards Peter

    Hi Peter,
    I check the SR well I think it not so see to reproduce in other environment.
    But we can instead to engineer to reproduce on their environment.
    But as of I would suggest to use command line or silent mode to install wls.
    Going through GUI will have many complex issue on OS to OS base so best practice is to have such installation using command line or silent modes.
    Note: If engineer is unable to reproduce such issue in their environment then Oracle will not consider that is BUG then there would be issue in your environment only.
    Regards,
    Kal

  • Encryption program does not work in IBM JDK

    Hi
    I have a encrypt, decrypt program, which does not work in IBM JDK
    the code is as below, it gives PBEWithMD5AndDES does not exist kind of error when running with IBM JDK
    import java.io.UnsupportedEncodingException;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import javax.crypto.Cipher;
    import javax.crypto.IllegalBlockSizeException;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    public class MapsPasswordUtil
         Cipher ecipher;
         Cipher dcipher;
         // 8-byte Salt
         byte[] salt = { (byte) 0xA9, (byte) 0x9B, (byte) 0xC8, (byte) 0x32,
                   (byte) 0x56, (byte) 0x35, (byte) 0xE3, (byte) 0x03 };
         // Iteration count
         int iterationCount = 19;
         public MapsPasswordUtil(String passPhrase)
              try
                   KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt,
                             iterationCount);
                   SecretKey key = SecretKeyFactory.getInstance("PBEWithMD5AndDES")
                             .generateSecret(keySpec);
                   ecipher = Cipher.getInstance(key.getAlgorithm());
                   dcipher = Cipher.getInstance(key.getAlgorithm());
                   // Prepare the parameter to the ciphers
                   AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt,
                             iterationCount);
                   // Create the ciphers
                   ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                   dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
              } catch (java.security.InvalidAlgorithmParameterException e)
                   e.printStackTrace();
              } catch (java.security.spec.InvalidKeySpecException e)
                   e.printStackTrace();
              } catch (javax.crypto.NoSuchPaddingException e)
                   e.printStackTrace();
              } catch (java.security.NoSuchAlgorithmException e)
                   e.printStackTrace();
              } catch (java.security.InvalidKeyException e)
                   e.printStackTrace();
         public String encrypt(String str)
              try
                   // Encode the string into bytes using utf-8
                   byte[] utf8 = str.getBytes("UTF8");
                   // Encrypt
                   byte[] enc = ecipher.doFinal(utf8);
                   // Encode bytes to base64 to get a string
                   return new sun.misc.BASE64Encoder().encode(enc);
              } catch (javax.crypto.BadPaddingException e)
                   e.printStackTrace();
              } catch (IllegalBlockSizeException e)
                   e.printStackTrace();
              } catch (UnsupportedEncodingException e)
                   e.printStackTrace();
              return null;
         public String decrypt(String str)
              try
                   // Decode base64 to get bytes
                   byte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str);
                   // Decrypt
                   byte[] utf8 = dcipher.doFinal(dec);
                   // Decode using utf-8
                   return new String(utf8, "UTF8");
              } catch (javax.crypto.BadPaddingException e)
                   e.printStackTrace();
              } catch (IllegalBlockSizeException e)
                   e.printStackTrace();
              } catch (UnsupportedEncodingException e)
                   e.printStackTrace();
              } catch (java.io.IOException e)
                   e.printStackTrace();
              return null;
    }

    Works for me with the latest IBM JDK. You will need to specify your context i.e. what platform, what JDK/JRE etc etc etc.
    P.S. That exception handling is rubbish.
    Edited by: sabre150 on Mar 23, 2009 6:01 AM
    I suspect that you are using JDK 1.5 and that you have fallen foul of the bug where key.getAlgorithm() does net return the correct value. You get round this by specifying it as             SecretKey key = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(keySpec);
                ecipher = Cipher.getInstance("PBEWithMD5AndDES");Of course if you are clever you will just define a static final constant for this algorithm.
    Edited by: sabre150 on Mar 23, 2009 6:09 AM

  • ISQLPLUS does not works after downgrading JDK.

    Hi,
    I am not sure if ISQLPLUS has anything to do with downgrading JDK. To my understand apache has its own classpath set. I have properly configure ISQLPLUS last week and no issues at all. This week, I am trying to downgrade my JDK (Sun) from 1.3.1 to 1.2.2. Soon after that i cannot access to my ISQLPLUS at all. It says FIle not found: Error 404. I haven't change any of my conf file, and apache start properly as well.
    I have a few JDK version on my machine at this point of time. 1.2.2 (IBM), 1.3.1(Sun), and 1.3.2 (Sun) . I am using them for different projects. And I believed Apache has its own version as well (1.7.1 ??).
    Any hints what am I getting Error 404?
    Thanks
    -KL

    What do you mean by "restoring definitions"?
    What EXACTLY is your problem?
    "does not works" is just a bit vague.

  • Could not find an installed JDK, SCM Java Tools may not work until registry

    Hello all,
    I've downloaded the latest full version of Designer (10.1.2.3), but getting installation error: Could not find an installed JDK, SCM Java Tools may not work until registry
    Any solution?

    3. install the Designer 10.1.2.3 patch to the Developer suite home.When I try to do this at C:\oracle\product\Ora10gDSR2, I get a message OUI-10137: An Oracle Home with name OUIHome already exits at C:\OraHome (a directory that doesn't exist) please specify another name for Oracle Home.
    I don't want to just specify another name because cleaning up these faulty installations requires deleting registry keys, etc, since the deinstall does't really remove everything sufficiently to start with a clean slate.
    I also got the Java JDK message because the JDK 5 is no longer being put straight onto the C drive, it is buried in C:\Sun\SDK\jdk, so some java programs have to be pointed to it. The Oracle installer doesn't provide this option.
    Also, Michael, your post, "Re: Designer 10.1.2.3 on windows Xp Posted: Oct 20, 2007 7:05 AM in response to: mmehdi" is full of unreadable characters and question marks. Maybe I don't have a font you are using. There are also references to a zip file and a Word document that aren't there.
    Anyway, thanks for all your time and effort,
    Edward

  • Copy/Paste worked in JDK 1.4 and does not work more for Java 1.4.1_01

    Hi all,
    in JDK 1.4.0 we can use the copy/paste between the java applets and other windows applications but in JDK 1.4.1_01 it does not work more!!!
    there is a simple JApplet code:
    import java.awt.*;
    import javax.swing.*;
    public class JApplet1 extends JApplet
         public void init()
              getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
              getContentPane().setLayout(null);
              setSize(426,266);
              getContentPane().add(JTextField1);
              JTextField1.setBounds(72,72,283,64);
         javax.swing.JTextField JTextField1 = new javax.swing.JTextField();
    and the start html page the the Japplet
    <HTML>
    <HEAD>
    <TITLE>Autogenerated HTML</TITLE>
    </HEAD>
    <BODY>
    <OBJECT classid="clsid:CAFEEFAC-0014-0001-0000-ABCDEFFEDCBA"
    width="500" height="200" >
    <PARAM name="code" value="JApplet1.class">
    <PARAM name="codebase" value=".">
    <PARAM name="type" value="application/x-java-applet;jpi-version=1.4.1">
    <PARAM name="scriptable" value="true">
    No Java 2 SDK, Standard Edition v 1.4.1 support for APPLET!!
    </OBJECT>
    </BODY>
    </HTML>
    Any ideas?
    Best regards

    Hi,
    I have found out the cause for the issue: before you install 1.4.1_01.exe you must deinstall all JRE's on your computer (1.3.XX, 1.4.0.XX) than works that well the Copy/Paste.
    that is confusingly because we don't have to make that in JRE 1.4.0.
    Best regards

  • JDK 1.6_07 with Windows: System.out.flush() does not work...

    I wonder if this is a known issue: Since I upgrade the jdk1.6 version to the _07 pack, text IO does not work anymore with WinXP cmd.exe window. Assuming a static import of System.out, I use:
    static void prompt()
      out.print(pr); //pr is a prompt string...
      out.flush();
    }works as usual with Unix/Linux, but with windows nothing will be written to the terminal, until I make at least one input. In that case a barrage of cached prompts appear all at once.
    Do we have a bug for it, can we work around somehow?
    Thomas

    Since this code works correctly in Java 6u10 on Windows XP
    System.out.print("This is the data");
    System.out.flush();You are apparently doing something unusual or wrong. What is "out"?
    Show a small sample program that compiles and exhibits the problem when executed.

  • JTable not working in JDK 1.6

    Hi
    In my Application I am using JTable for diplay and sorting purpose.Its properly working with JRE 1.5.
    But When i try to run the same application in JRE 1.6 the sorting functionality is not working properly.
    plz let me know what is the difference between running the application in JRE 1.5 and JRE 1.6?
    Thanks in Advance
    Kumar

    Pls. post the SSCCE program.

  • JRE/JDK 1.3.1_19 Not working with OS Patched Windows 2003 Server DST 2007

    Hello:
    We are trying to upgrade our 1.3.1_03 application with 1.3.1_19. It worked fine in a machine (WIndows Server 2003) where OS was not patched for DST. However, as far as I could see if the OS is patched the DST compliant java (1.3.1_19) is not working.
    I go to the jre/bin and try to do a java -version and I see nothing from OS patched machine.
    Non-OS Patched machines, it works and I could see the java version.
    Has anybody faced this problem?
    Really appreciate any suggestion.
    Cheers,
    Abdullah

    Hey
    came across same problem. but dont know for sure if it is the DST patch that is the problem. if you have come across anything further update on the issue let us know.
    Cheers

  • Jdk 1.4 install - "." in Classpath not working

    Hello friends,
    I have installed jdk1.4. However "javac" won't compile files that include classes in the current dir:
    import classname;
    I keep getting error
    import classname;
    ^ "." expected.
    But the first thing in my CLASSPATH is ".;..".
    I don't see why it is not working properly. The system is windows 2000, and it was set up as enviroment variable. It worked fine with jdk1.3.
    Help!

    Found the problem - since they are in the same dir, shouldn't include them in "import..." at all.

  • Exporting Crystal Report to HTML is not working in Windows 7

    Hi Sir,
    I am trying to export Crystal Report to HTML format using VB.NET code. Functionality is working fine at Windows XP Environment (Save to Disk, Open an Application and Email Attachment). But the same functionality is not working at Windows 7 Environment (both 32-Bit as well as 64-Bit).
    Below is the code to Exporting Crystal Report to HTML in VB.NET.
    Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions
    Dim CrFormatTypeOptions          As New HTMLFormatOptions
    Dim vFormat As Integer
    Dim CrExportOptions As New ExportOptions
    Dim vRdReport As New ReportDocument
    Dim sfd As SaveFileDialog
    Dim vFileName As String = Nothing
    vRdReport = vRptSource
    sfd = New SaveFileDialog
    If Not (vRptPath = "") Then
        sfd.InitialDirectory = vRptPath
    End If
    sfd.Filter = "Webpage, Complete(.htm;.htm)|.htm|Web Archive, Single file(.mht)|.mht|Webpage, HTML only(.htm;.html)|.html"
    If sfd.ShowDialog = DialogResult.OK Then
        ' Set the disk file options.
         CrDiskFileDestinationOptions.DiskFileName = sfd.FileName.ToString()
    Else
         Return
    End If
    CrExportOptions = vRdReport.ExportOptions
    CrFormatTypeOptions.HTMLFileName = vFileName
    CrFormatTypeOptions.HTMLEnableSeparatedPages = True
    CrFormatTypeOptions.HTMLEnableSeparatedPages = True
    CrFormatTypeOptions.HTMLHasPageNavigator = True
    CrFormatTypeOptions.UsePageRange = True
    With CrExportOptions
                        .ExportDestinationType = ExportDestinationType.DiskFile
                        .ExportFormatType = ExportFormatType.HTML32
                        .DestinationOptions = CrDiskFileDestinationOptions.DiskFileName
                        .FormatOptions = CrFormatTypeOptions
    End With
    vRdReport.Export()
    Catch ex As Exception
            MsgBox(ex.ToString)
    End Try
    Code working fine at Windows XP, But it is not woking in Windows 7 environment.
    Please can anyone share your valuable thoughts or ideas reg. this.
    Thanks in Advance
    Deivanayaga Perumal D.

    user13509659 wrote:
    Run this code to reproduce the issue.Which issue?
    It looks like inheritance is broken in the component hierarchy for JFrame in Windows 7 JDK 1.6.0_23-b05. The only thing remotely related to inheritance in your code snippet is the WindowListener, which does little. See camickr's advice about built-in exit management.
    EDIT - using the post title as a clue, I realize you may be talking about the component hierarchy, and whether the contentPane's background is visible through the upper layers. Instead of guessing, I'd prefer you describe your "issue" accurately (observed vs expected behavior).
    Edited by: jduprez on Feb 10, 2011 1:01 PM

Maybe you are looking for

  • Hello I am just wondering why there is a message of error 1004 when i tryed to make the update on my apps. Does someone know what it means?

    Hello I am just wondering why there is a message of error 1004 when i tryed to make the update on my apps. Does someone know what it means?

  • Downloading Vendor Email ID in SRM

    Hi, Need to download Vendors Email ID for all vendors in SRM,w/o help of Query and ABAP. I am aware of table BUT000 and ADR6..and ADR6 stores all vendor Email's but i am not able to find a linking table between BUT000 and ADR6. The Address field in B

  • Imac 27 resolution little characters

    Hi, I have a big problem with my Imac, all characters are very too little, i have to change with the program tinkertool, but it's no fine ! How to fix this issue I have used the zoom but its no corect It no exists a program for fixing this issue ????

  • Probelm with email quality and printing

    Why is it that when I receive a photo via email I cannot print it out without receiving an exclamation point in a yellow triangle and then when I do print it out it's all pixilated? The image I receive is also smaller than the others in my photo albu

  • Can I edit?

    I totally green here. I have an old version of Acrobat - prof 7. A friend sent me a pdf with complex tables. I thought instead of making my own document, I could open her pdf in Acrobat and edit. But I tried and don't see a way to edit the cells. Is