Getting Java set up - javac and PATH problems..

Just as the title suggests, I am brand new to Java. I am getting the seemingly "classic" newbie Java error in comman prompt: " 'javac' is not recognized as an internal or external command, operable program or batch file." I have read help sites and threads, and I do believe it must be something wrong with my PATH environments, but I can't figure out what. Also, I have tried several different java versions, so I can only believe that my current version is jdk1.6.0_03 (According to the official website I have 6, Version 3). I am running Windows XP (Service Pack 2).
Here is the exact text as listed in the variable PATH: C:\ WINNT; C:\ WINNT\ SYSTEM32; C:\ jdk1.6.0_ 03\ bin
I also have another variable called CLASSPATH, which is: .;C:\Program Files\Java\j2re1.4.2\lib\ext\QTJava.zip
A friend suggested that I learn with DrJava, because he said that is the way he learned, but of course that only helped with learning some basic code, and it only postponed the problem I am now having to face.
I know I am utterly useless, and I am sure that whatever alien language I just put up there must be just way off base, but please bear with this poor beginner. Any help is useful, literally any, and I am going to wipe any previous thoughts of what I thought was correct away.

Are you able to set the PATH without any errors on command line ? Or another best way is to set the path in the user and system variables.
Go to
MyComputers->Properties->Advanced (tab)and click the
Environment VariablesAbove you will see
User variables
IF there is already a variable name PATH then add the
C:\jdk1.6.0_03\binElse
Click the
New type PATH as the Variable Name
and the C:\jdk1.6.0_03\bin as the variable value.
Re-start your command prompt and check with the javac or java commands.

Similar Messages

  • Java Audio Metronome | Timing and Speed Problems

    Hi all,
    I’m starting to work on a music/metronome application in Java and I’m running into some problems with the timing and speed.
    For testing purposes I’m trying to play two sine wave tones at the same time at regular intervals, but instead they play in sync for a few beats and then slightly out of sync for a few beats and then back in sync again for a few beats.
    From researching good metronome programming, I found that Thread.sleep() is horrible for timing, so I completely avoided that and went with checking System.nanoTime() to determine when the sounds should play.
    I’m using AudioSystem’s SourceDataLine for my audio player and I’m using a thread for each tone that constantly polls System.nanoTime() in order to determine when the sound should play. I create a new SourceDataLine and delete the previous one each time a sound plays, because the volume fluctuates if I leave the line open and keep playing sounds on the same line. I create the player before polling nanoTime() so that the player is already created and all it has to do is play the sound when it is time.
    In theory this seemed like a good method for getting each sound to play on time, but it’s not working correctly.
    At the moment this is just a simple test in Java, but my goal is to create my app on mobile devices (Android, iOS, Windows Phone, etc)...however my current method isn’t even keeping perfect time on a PC, so I’m worried that certain mobile devices with limited resources will have even more timing problems. I will also be adding more sounds to it to create more complex rhythms, so it needs to be able to handle multiple sounds going simultaneously without sounds lagging.
    Another problem I’m having is that the max tempo is controlled by the length of the tone since the tones don’t overlap each other. I tried adding additional threads so that every tone that played would get its own thread...but that really screwed up the timing, so I took it out. I would like to have a way to overlap the previous sound to allow for much higher tempos.
    I posted this question on StackOverflow where I got one reply and my response back explains why I went this direction instead of preloading a larger buffer (which is what they recommended). In short, I did try the buffer method first, but I want to also update a “beat counter” visual display and there was no way to know when the hardware was actually playing the sounds from the buffer. I mentioned that on StackOverflow and I also asked a couple more questions regarding the buffer method, but I haven’t received any more responses.
    http://stackoverflow.com/questions/24110247/java-audio-metronome-timing-and-speed-problems
    Any help getting these timing and speed issues straightened out would be greatly appreciated! Thanks.
    Here is my code...
    SoundTest.java
    import java.awt.*; 
    import java.awt.event.*; 
    import javax.swing.*; 
    import javax.swing.event.*; 
    import java.io.*; 
    import javax.sound.sampled.*; 
    public class SoundTest implements ActionListener { 
        static SoundTest soundTest; 
        // ENABLE/DISABLE SOUNDS 
        boolean playSound1  = true; 
        boolean playSound2  = true; 
        JFrame mainFrame; 
        JPanel mainContent; 
        JPanel center; 
        JButton buttonPlay; 
        int sampleRate = 44100; 
        long startTime;  
        SourceDataLine line = null;  
        int tickLength; 
        boolean playing = false; 
        SoundElement sound01; 
        SoundElement sound02; 
        public static void main (String[] args) {        
            soundTest = new SoundTest(); 
            SwingUtilities.invokeLater(new Runnable() { public void run() { 
                soundTest.gui_CreateAndShow(); 
        public void gui_CreateAndShow() { 
            gui_FrameAndContentPanel(); 
            gui_AddContent(); 
        public void gui_FrameAndContentPanel() { 
            mainContent = new JPanel(); 
            mainContent.setLayout(new BorderLayout()); 
            mainContent.setPreferredSize(new Dimension(500,500)); 
            mainContent.setOpaque(true); 
            mainFrame = new JFrame("Sound Test");                
            mainFrame.setContentPane(mainContent);               
            mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
            mainFrame.pack(); 
            mainFrame.setVisible(true); 
        public void gui_AddContent() { 
            JPanel center = new JPanel(); 
            center.setOpaque(true); 
            buttonPlay = new JButton("PLAY / STOP"); 
            buttonPlay.setActionCommand("play"); 
            buttonPlay.addActionListener(this); 
            buttonPlay.setPreferredSize(new Dimension(200, 50)); 
            center.add(buttonPlay); 
            mainContent.add(center, BorderLayout.CENTER); 
        public void actionPerformed(ActionEvent e) { 
            if (!playing) { 
                playing = true; 
                if (playSound1) 
                    sound01 = new SoundElement(this, "Sound1", 800, 1); 
                if (playSound2) 
                    sound02 = new SoundElement(this, "Sound2", 1200, 1); 
                startTime = System.nanoTime(); 
                if (playSound1) 
                    new Thread(sound01).start(); 
                if (playSound2) 
                    new Thread(sound02).start(); 
            else { 
                playing = false; 
    SoundElement.java
    import java.io.*; 
    import javax.sound.sampled.*; 
    public class SoundElement implements Runnable { 
        SoundTest soundTest; 
        // TEMPO CHANGE 
        // 750000000=80bpm | 300000000=200bpm | 200000000=300bpm 
        long nsDelay = 750000000; 
        long before; 
        long after; 
        long diff; 
        String name=""; 
        int clickLength = 4100;  
        byte[] audioFile; 
        double clickFrequency; 
        double subdivision; 
        SourceDataLine line = null; 
        long audioFilePlay; 
        public SoundElement(SoundTest soundTestIn, String nameIn, double clickFrequencyIn, double subdivisionIn){ 
            soundTest = soundTestIn; 
            name = nameIn; 
            clickFrequency = clickFrequencyIn; 
            subdivision = subdivisionIn; 
            generateAudioFile(); 
        public void generateAudioFile(){ 
            audioFile = new byte[clickLength * 2]; 
            double temp; 
            short maxSample; 
            int p=0; 
            for (int i = 0; i < audioFile.length;){ 
                temp = Math.sin(2 * Math.PI * p++ / (soundTest.sampleRate/clickFrequency)); 
                maxSample = (short) (temp * Short.MAX_VALUE); 
                audioFile[i++] = (byte) (maxSample & 0x00ff);            
                audioFile[i++] = (byte) ((maxSample & 0xff00) >>> 8); 
        public void run() { 
            createPlayer(); 
            audioFilePlay = soundTest.startTime + nsDelay; 
            while (soundTest.playing){ 
                if (System.nanoTime() >= audioFilePlay){ 
                    play(); 
                    destroyPlayer(); 
                    createPlayer();              
                    audioFilePlay += nsDelay; 
            try { destroyPlayer(); } catch (Exception e) { } 
        public void createPlayer(){ 
            AudioFormat af = new AudioFormat(soundTest.sampleRate, 16, 1, true, false); 
            try { 
                line = AudioSystem.getSourceDataLine(af); 
                line.open(af); 
                line.start(); 
            catch (Exception ex) { ex.printStackTrace(); } 
        public void play(){ 
            line.write(audioFile, 0, audioFile.length); 
        public void destroyPlayer(){ 
            line.drain(); 
            line.close(); 

    Thanks but you have never posted reply s0lutions before ?? And F 4 is definitely not 10 times faster as stated before I upgraded !!

  • I have been infected by trove adware, I was able to remove it, but I couldn't get default setting of safari and keeping bookmarks, saved passwords, ..etc

    I have been infected by trove adware, I was able to remove it, but I couldn't get default setting of safari and keeping bookmarks, saved passwords, ..etc

    There is no need to download anything to solve this problem.
    You may have installed the "Trovi," "Conduit," or "SearchProtect" ad-injection malware. Follow the instructions on this Apple Support page to remove it.
    Back up all data before making any changes.
    Besides the files listed in the linked support article, you may also need to remove these files in the same way:
    ~/Library/Application Support/Firefox/searchplugins/MyBrand.xml
    ~/Library/Application Support/Google/Chrome/External Extensions/fjadmdmahkpbhgbmmkiiaanlnlekelmn.json
    ~/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]
    One of the steps in the article is to remove malicious Safari extensions. Do the equivalent in the Chrome and Firefox browsers, if you use either of those. If Safari crashes on launch, skip that step and come back to it after you've done everything else.
    If you don't find any of the files or extensions listed, or if removing them doesn't stop the ad injection, then you may have one of the other kinds of adware covered by the support article. Follow the rest of the instructions in the article.
    Make sure you don't repeat the mistake that led you to install the malware. Chances are you got it from an Internet cesspit such as "Softonic" or "CNET Download." Never visit either of those sites again. You might also have downloaded it from an ad in a page on some other site. The ad would probably have included a large green button labeled "Download" or "Download Now" in white letters. The button is designed to confuse people who intend to download something else on the same page. If you ever download a file that isn't obviously what you expected, delete it immediately.
    "SearchProtect" may be distributed along with two other applications: "MacKeeper," which is a scam, and "ZipCloud," which, if not actually a scam, has a dubious reputation. Ask if you need instructions to remove those items.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • Command line parameters and path problem

    hello ....
    I have to execute an application from my java program. My application called "AIMSS" takes 2 command line parameters. Now, when i mention those parameters with complete path to my executeable, windows reports that "unable to open the shortcut". Below is what i am trying:
    private static final String WIN_PATH = "rundll32";
    private static final String WIN_FLAG  "url.dll,FileProtocolHandler";
    private String cmd = null;
    private String url = null;
    public void runMyFileWithMessage(String msg)
        try
    url = "C:\\Program Files\\Raytheon\\AIMSS 4.0\\Runtime\\Standard\\aimss40.exe" + " AAAVIETM 3457";
                 cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
                 System.out.println(url);
                 Runtime.getRuntime().exec(cmd);
            catch(IOException io)
                System.out.println("AIMSS problem. Below is the Stack Trace.");
                io.printStackTrace();
        }Although, when i tried to run the executeable from Start->Run, by giving it same complete path and 2 arguments, it runs fine. Any help would be greatly appreciated.
    Raheel.

    Passing multiple paramters in a String to exec() doesn't work. Use the exec method that takes a String array instead and pass the call and each parameter in as a separate String.
    Off the top of my head (check the api) it will be something like
    String[] cmd = {"C:\\Program Files\\Raytheon\\AIMSS 4.0\\Runtime\\Standard\\aimss40.exe","AAAVIETM", "3457"};
    Runtime.getRuntime().exec(cmd);

  • Java with Derby embedded and threads - problem?

    Hello,
    been developing java app and recently switched to derby database. At first i insert some data into derby and my app populates fine. However when my app creates a new thread (to do something in background and then updates the derby database) it all goes wrong. The thread is not responding and the database is not updating..
    What could this be?
    Could this be a database issue with java,jdbc, derby or just threads in general?
    It was working before previously with my previous database: MySQL which runs in a separate process but an embedded derby just wont make it happen.

    you're probably right that i'm making conclusions early but i've done everything i could and the feeling is like you want to give up. You feel de-motivated.
    I've been switching a lot of databases and trying them out and it seems that i can't get it to work with the embedded databases for some reasons. Could it possibly be some other stuff that i'm running in the background.
    Because, my background tasks is really heavy:
    - it creates a few threads to do tasks which some of them recieve information remotely from other machines, a few loops here and there, a few other threads with starts up a few processes (external exe's) to do some work and finally a few threads to do some calculation & update the database..
    But on the brightside i know my app works with my local MySQL database which runs in a separate process. I can also get my app to work with an online database on a hosting site - but the connection is very very slow (20 times as much time it takes to connect, i actually timed it.)

  • Open VI reference and paths problem

    Hi,
    in my project I need to have a VI running independently from the calling VI so I use VI Server and "Open VI reference" to run the VI. However this is not without problems. The VI that I run is not in the same folder, as the caller VI and also not on a fixed location on disk, so I use relative paths (something like "..\subfolder\myVi.vi"). This works in the project and .exe but not e.g. in a .llb file where there seems to be no folder structure anymore.
    Actually I'd prefer if this would not use paths on disk at all but if I could somehow create a reference to another VI in my project and it would even work if the VI's location on disk changed (and is updated in the project). I think it is quite confusing that I have to care about physical location of the VI here when I use the project browser for everything else. Is there a way to accomplish this? Or is there even a better way to start a VI that keeps running even after the caller stopped?
    Thanks,
    Tobias

    As far as I've seen, every VI has the path ../Application.exe/currentvi.vi when you are running in a build.  Therefore, to open another VI you have to strip the current vi's path once, and add the other vi. 
    I have written a VI that determines whether or not I'm running from a build, it is attached.  It returns true if you're in a build, and also the current vi's path stripped once giving you ../Application.exe.
    The way I use the VI is pictured below.  I send the stripped path Is Executable returns and the relative path (minus the vi name) into a Select icon which is wired to the boolean Is Executable returns.  Then I add the other VI name to the path.
    Message Edited by elset191 on 04-21-2009 10:43 AM
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect
    Attachments:
    Is executable.vi ‏8 KB
    untitled.JPG ‏7 KB

  • How to get the set pf-status and call Transaction work together in SA

    hi,
    I am using Set pf-status to display the details screen and the same time using call transaction va03 leave screen 0 to display the corresponing sales order.
    The issue is both of them are not workin together properly.
    it could be helpfull if you give some code which deals the issue in detail...
    can you please give details how to get the previous screen once the new screen is obtained thru set pf-status
    thanks and regards
    Edited by: san dep on Jul 10, 2008 6:25 PM

    Hi,
    Try this code ---
    SET PF-STATUS 'STATUS_NAME' OF PROGRAM 'ZPROGRAM_NAME'.
    Regards
    Pinaki

  • Getting Java error when build and deploy through eclipse designer.

    hello,
    My while activity looks like this -
    <while condition="bpws:getVariableData(&quot;integer&quot;)&lt;=count(bpws:getVariableData('GetRCItem-GetItemResponse', 'parameters', '/schemattwebservices:GetItemResponse/schemattwebservices:return/schemattwebservices:extendedFieldList[schemattwebservices:name=&quot;LIST_OF_TASKS&quot;]')/schemattwebservices:values)" name="ProcessRCTasks">
    It passes the validation but fails when I click on build and deploy.
    D:\dev\admin.console.trunk\workspace\ServiceFlow\temp\bpelc42058.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:2129: ';' expected.
    [bpelc] return "bpws:getVariableData("integer")<=count(bpws:getVariableData('GetRCItem-GetItemResponse', 'parameters', '/schemattwebservices:GetItemResponse/schemattwebservices:return/schemattwebservices:extendedFieldList[schemattwebservices:name="LIST_OF_TASKS"]')/schemattwebservices:values)" ;
    Please let me know what is wrong here and why is it giving me that java error? It should be better in reporting error and give it in BPEL terms.
    - Meghana

    I switched my compiler to use Oracle's bundled jre but I still get following 2 errors -
    [bpelc] D:\dev\admin.console.trunk\workspace\ServiceFlow\temp\bpelc33065.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:2129: ';' expected.
    [bpelc] return "bpws:getVariableData("integer")<=count(bpws:getVariableData('GetRCItem-GetItemResponse', 'parameters', '/schemattwebservices:GetItemResponse/schemattwebservices:return/schemattwebservices:extendedFieldList[schemattwebservices:name="LIST_OF_TASKS"]')/schemattwebservices:values)" ;
    [bpelc] ^
    [bpelc] D:\dev\admin.console.trunk\workspace\ServiceFlow\temp\bpelc33065.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:2982: ';' expected.
    [bpelc] return "bpws:getVariableData("index2")<=count(bpws:getVariableData('GetRCTaskItem-GetItemResponse', 'parameters', '/schemattwebservices:GetItemResponse/schemattwebservices:return/schemattwebservices:extendedFieldList[schemattwebservices:name="ZMF_PACKAGES"]')/schemattwebservices:values)" ;
    [bpelc] ^
    [bpelc] 2 errors
    Any idea? I have already pasted my while condition which has this condition on it. Second while is similar to first one.
    Thank you.
    - Meghana

  • JAR and Paths problem

    Hi, I wrote an app and jar it in a file. However when the code tries to instantiate objects in another jar file (which is in the classpath) it throws a java.lang.NoClassDefFoundError. Arggh...its frutstrating when it works "unjar".
    BTW inside the app I created images using ImageIcon e.g. ImageIcon imageIcon = new ImageIcon("xxx.jpg"); Will the code automatically look into the jar file for the image file? Thanks

    While I cannot currently speak to the files within a separate JAR file, I can speak to loading the images from within a JAR file.
    You should try the following:
    ImageIcon image = new ImageIcon((new Object()).getClass().getResource("/<path_to_the_graphic/image.gif>"));where the path to the graphic would be the same as the classpath. For example, if the classpath to the graphic was:images.image.gif you would type "/images/image.gif"This will actually pull the graphic as a URL location from within the JAR file.

  • I have just had my iPad stolen. I by mistake pressed delete rather than find and lock. It has not been activated. Can I remove delete and get it set to locate and lock now.

    Please can somebody help me. I have just had my iPad stolen. Used I could to try to locate it buy pressed delete by mistake. Any e
    Way to reverse this and then use locate and lock instead.

    What To Do If Your iDevice Is Lost Or Stolen
    If you activated Find My Phone before it was lost or stolen, you can track it only if Wi-Fi is enabled on the device. What you cannot do is track your device using a serial number or other identifying number. You cannot expect Apple or anyone else to find your device for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty.
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should have done in advance - before you lost it or it was stolen - and some things to do after the fact. Here are some suggestions:
    This link, Re: Help! I misplaced / lost my iPhone 5 today morning in delta Chelsea hotel downtown an I am not able to track it. Please help!, has some good advice regarding your options when your iDevice is lost or stolen.
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T. Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. What to do if your iOS device is lost or stolen
      6. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      7. Find My iPhone
      8. Report Stolen iPad | Stolen Lost Found Online
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on iCloud
      3. OS X Lion/Mountain Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)

  • Set Root Directory and Path

    Hi Guys,
    I put my jsp files in a folder in WEB-INF, but CSS, and IMAGES folders are under default root folder pblic_html. Now my jsp pages don't show the images and css effects, if I correct the path manually in JSP pages, they work fine.
    What is there correct way to fix it, like as done in Toystore Demo.
    I have tried it by writing messages in ApplicationResources.properties file, but it shows the path in the JSP pages.

    Hi mtmnd,
    ever noticed the file constant palette? Ever read the help for "current VI's path"?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I believe I've downloaded Firefox, but I get no set up window and your icon isn't on my desktop

    I have a new laptop with Windows 8. I clicked on run to download the latest Firefox, and it completed. but there's no evidence of Firefox anywhere...no desktop icon or dialogue box to set up a homepage

    Download and save the Firefox installer to the desktop and start the installation with a double-click on the desktop icon.
    If the file is missing or corrupted then it is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files.<br />
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See:
    *http://kb.mozillazine.org/Unable_to_save_or_download_files

  • When downloading Firefox, the second time I click run I do not get the set up wizard and Firefox won't install on my PC. Why?

    When I first click download and run, It takes about 2.5 minutes to download the program. It then prompts me to click run again, but this time instead of taking me to the Wizard as it says it will, it processes for about 2 seconds and all prompts go away without installing Firefox.

    Hi sahgin,
    The issue eventually resolved itself, I still don't really know why. I kept up with Windows update, and attempted downloading iTunes again from the Apple website, and it just... worked. It now works fine. I don't know why it took approximately 4 months to work, though.
    I'm sorry I don't have any more helpful information. Posting here was my last resort, and clearly Apple never bothered to reply.

  • Can't  find javac and javadoc

    Hi, I believe I set the JAVA_HOME and path variable correct, but when I type command line command "javac" and "javadoc", they are not recognized. But the command "java" is recognized.
    Anybody would let me know how to sort it out? Thanks

    try these at the command prompt.
    PATH=%PATH%;<specify the java directory>/bin;.;
    set CLASSPATH=%CLASSPATH%;<specify the java directory>/lib;.;
    if u r using unix flavours you can change the syntax accordingly.
    this should sort it out. also, if java is working, so should javac. paste the error message what u are getting. that might help solving the problem fast.

Maybe you are looking for