I'm new to Java and can't get javac command working

Ok first of all hello ( i'm new to the forum ), second i'm reading a book about Java and im trying to compile a sample code from the book, but javac command gained life and it's against me. So the book i'm reading is Sams Teach Yourself Java in 21 Days (YAY), and the code i want to compile is an application that works with another bit of code that mimics what a robot could do inside a volcano. So the Volcano program code is the following ( i'll post the robot code at the end of the post):
1: class VolcanoApp {
2: public static void main(String[] arguments) {
3: VolcanoRobot dante = new VolcanoRobot();
4: dante.status = ?exploring?;
5: dante.speed = 2;
6: dante.temperature = 510;
7:
8: dante.showAttributes();
9: System.out.println(?Increasing speed to 3.?);
10: dante.speed = 3;
11: dante.showAttributes();
12: System.out.println(?Changing temperature to 670.?);
13: dante.temperature = 670;
14: dante.showAttributes();
15: System.out.println(?Checking the temperature.?);
16: dante.checkTemperature();
17: dante.showAttributes();
18: }
19: }
Ignore the numbers they are used for explaining stuff in the book, and i din't copy the indentation.
So what i do is that i creat a file with notepad ( no fancy stuff only plain old notepad ) and i copy this code, remove the numbers and make the indents.
After that i save as .txt file with the apropriate name ( i know it's case sensitive ). After that i open command prompt and write:
javac VolcanoApp.java
And it tells me that "javac is not recognized as an internal or external command operable program or batch file".
I managed to solve that by going to the control panel and by adding to the system variables for my user in the path variable this :
;C:\JAVAJDK\bin
( C:\JAVAJDK is where JDK is installed)
And then i modified the system variables like this:
In the CLASSPATH i entered this .;%JAVA_HOME%\lib\tools.jar
In JAVA_HOME i entered this C:\JAVAJDK
Setting the variables like this made the javac error go away but now when i write in command line
javac VolcanoApp.java
It gives me this error
javac: file not found : VolcanoApp.java
Usage: javac options source files
use -help for a list of possible options
And then i read that i can drop my java file directly in the javac file. So i did.
When i drop my VolcanoApp.java in the javac file it open a command line window and writes a bunch of stuff in like a milisecond and shuts down. And no file is created.
I wanted to know what was writen in that window so i did it again and took a print screen and pasted it on paint ( it writed so much text that i only got a little bit but enough to see what hapend)
I read it and in the print screen it said it had 15 errors ( so far ) and then it point the errors with little arrows and there were characters that weren't present in the original code.
What hapend the compiler added wierd letters?
SO, my real question is, how the heck do i get javac working and compiling stuff properly?
Plz help i'm getting mad at this! ; (
And the code for the "robot":
1: class VolcanoRobot {
2: String status;
3: int speed;
4: float temperature;
5:
6: void checkTemperature() {
7: if (temperature > 660) {
8: status = ?returning home?;
9: speed = 5;
10: }
11: }
12:
13: void showAttributes() {
14: System.out.println(?Status: ? + status);
15: System.out.println(?Speed: ? + speed);
16: System.out.println(?Temperature: ? + temperature);
17: }
18: }
Again no indents and ignore the numbers. In the book it only said to compile the VolcanoApp.java , and not the VolcanoRobot.java
Edit:
I'm using Windows Vista Home Premium 32 bit.
Edited by: BBlop on Dec 13, 2009 11:29 AM

guess what it says java file. So yes i'm sure. Sarcasm. Not the best way to encourage a total stranger to help you. Then there's
Sorry if i wasn't more clear but was that response needed?No it wasn't needed, but I'm not the one asking for help so I have the luxury of not worrying too much about it. It's extremely frustrating trying to drag relevant information out of someone, and makes one less inclined to bother.
Anyways, there's still nothing in this thread that actually explicitly says "there is a file called VolcanoApp.java in the directory where I'm running javac from" and I really can't be bothered banging my head against the wall any longer. You've made a silly mistake, or a false assumption. We all do it from time to time. My advice is, take a break, go for a walk and re-visit this in a while. You'll probably spot the mistake right away.

Similar Messages

  • New to ePrint and can't get it to work

    I have set up my new printer and have set up the ePrint.  Everything appears to be working but nothing I email to the printer prints or shows up in the ePrint center.  I have verified twice the address is correct and the printer is connected to the web.

    Hi jlarrabee,
     There is an option under ePrint Settings to set to "Allowed Senders Only".
    If this is set only allowed senders or whitelisted email address can eprint to the printer.
    Just to check, did you receive any email notification from the ePrintCenter on jobs received or invalid email address?
    Have you tried sending email using web based emai client such as gmail, yahoo...etc?
    Another option is to login to ePrintCenter, select ePrint Settings >> Advanced tab >> Reset email address.
    This will generate a new email address.
    Could you please try to eprint again to the new email address.
    Thank you.
    I am an HP employee
    **** Please mark the post that solves your problem as "Accepted Solution" ****

  • Help! New to Mac and can't get imovie to work

    hi
    i just bought a refurbished iMac and I'm trying to make/edit dvd's from my sony dcr-dvd203 camcorder. Since it says it doesn't support the camera I've tried burning the mini-dvd onto a regular dvd. but how do i import and save the contents of the disk drive so i can work on it?

    When i put the disc in the drive it plays on the DVD player but doesn't comeup on iMovie.
    Sounds like it is working properly. iMovie is not designed to to edit MPEG-2 content. Even if the DVD where in a camcorder and properly recognized, iMovie would have to demultiplex the AC3 content, convert it to AIFF and store it in a generic MOV file container. Also, since only about 6.67% of the video frames on the DVD are editable, the other 93.33$ would have to be converted to intra-frames before it could be merged with the audio. Even then, since audio and video of your original file was synchronized with each other spatially, offsets have to be generated to minimize drifting between the two tracks in a temporally synchronized MOV file container.
    Am not trying to "snow" you here with technical matters but just indicate some of the problems facing users of multiplexed MPEG-2 (HDD/DVD) content camcorders. Some work well with iMovie '08 while others may have problems with a particular work flow or simply don't work at all. In all cases, however, you the user can opt to do what iMovie '08 may not be able to do on its own -- manually convert the data to a suitable format which iMovie '08 can handle.
    As previously indicated, the MPEG-2 codec was developed as a distribution and delivery compression format -- not an editing format. It is well suited for delivery and viewing by DVD and Satellite because it condenses the data for compact storage or transmission via relatively narrow bandwidth. Essentially what you have to do is de-compress the data to a an edit compatible data format which is usually stored in files of much greater size. This means disregarding the original purpose for which the camcorder manufacturer specifically chose this particular storage medium.
    What I recommend is that new users simply download the free iSquint application. (This is the "smaller brother" application of Visual Hub.) Since it is free, does not require any special codecs, and is very simple to use, it make a good starting place for this type of conversion. Basically, if you can get your VOB or other "muxed" MPEG-2 content file to your hard drive, you should be able to convert it for use in iMovie '08. Even in its default opening mode, if you drop your "muxed" file to the work area, it will quickly create a 320x240 MPEG4/AAC which can be opened in iMovie '08. Using the "Optimize for TV" option will create a 640x480 standard VGA display file with somewhat better quality. Increasing the video data rate increase the video quality even more. (Actually, you are not really increasing the quality here, but rather simply preventing the unnecessary loss of video quality.) In any case, switching to H.264 compression format could possible improve quality even more since this compression format is 2.0-2.5 times as efficient as MPEG-4 used above but increases the amount of time required for the re-compression process.
    Thus, the paragraph above should allow the novice user to determine if his or her file can be easily made iMovie '08 "edit" compatible, as well as, explore some of the settings and their effects on the conversion process. Since the application is, as already stated, free, standalone, and easy to use, it allows the new user to evaluate the basic conversion process with only a small investment in terms of time. It also allows them to determine if they need or desire to invest money in more advanced programs allowing a wider variety of output formats, additional features, and the possible potential for even higher quality editing. This recommendation merely offers the interested user an opportunity to gain the necessary experience upon which to base a "more informed" decision regarding where to go/what to do next.

  • I'm trying to have existing Exchange accounts setup on my new iMac and can't get it to work.

    I have existing Exchange accounts setup on my iPhone and iPad to access my work email.  I'm trying to do the same on my new iMac and can't get it to work.  I have it setup the same as my iPad and it asks me for my password over and over...any suggestions?
    <Re-Titled By Host>

    Hi mwatts18,
    As a preliminary troubleshooting step, you should reference the information in the following article:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/TS3276
    I would especially suggest that you delete the account and re-add it, making sure that you are entering the correct password when you add the account. Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

  • I have a new mac pro and can't get a side scroll bar.  What can I do to get this?

    I have a new mac pro and can't get a side scroll bar.  How can I get this?

    The scroll bar is now set to appear automatically when you start scrolling with a trackpad or scroll wheel mouse. If you are using an mouse without a scrolling device, you should change a setting.
    In System Preferences, click General, and in the Show Scroll Bars section, click the option for how you want it to work. If you want to see them all the time click "Always."

  • I updated my OS from 10.6.4., to 10.8.2 I want to buy iDVD and I Movie, but bought iPhoto and can't get it to work yet.  Hesistant to buy the others without now having the original applications on my laptop. Do I need to buy the older versions first?

    I updated my OS from 10.6.4., to 10.8.2.  I want to buy iDVD and iMovie, but I bought iPhoto and can't get it to work yet.  I'm hesitant to buy the others without now having the original applications on my laptop. Do I need to buy the older versions first?  They are probably on my Snow Leopard install disc, but I am now running Mt Lion that I bought, and downloaded a few days ago...so I don't want to insert the old OS disc, thinking it might want to reinstall the old OS...  Thanks,
    KathyH-P

    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • HT1203 i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    It is almost as if the program does not exist on my computer. If I search for it, the only thing that comes up is the installer. I cannot find it anywhere despite the fact I have installed it numerous times, uninstalled it and conducted a fresh install, and the Adobe website checks says that it is installed.

  • After years of owning all things Mac, I am finally trying to use iChat, and can't get it to work. I see my buddy, but all I can do is send a message--the video and audio chat icons are gray, as is inviting to a video chat under Buddies.

    After years of owning all things Mac, I am finally trying to use iChat, and can't get it to work. I am using gmail, and I see my buddy (no camera icon next to her name), but all I can do is send a message--the video and audio chat icons are gray, as is inviting to a video chat under Buddies. My buddy has the same problem as I.  We are able to do video chat through gmail, but I had hoped to use iChat.  I am using OS 10.6.8, iChat v. 5.0.3.  What am I missing?

    HI,
    iChat will Video chat to another iChat in a Jabber Buddy List (Google run a Jabber server for GoogleTalk)
    However it will not Video to the Web Page login to iGoogle or the Web Mail Page login.  (where people can Google Chat as it were in a  Web Browser).
    Nor does it video to the Google Talk Stand alone app for PCs or any other Jabber apps on any platform.
    iChat uses a connection Process called SIP (Session Initiation Protocol) which is also used by other VoIP devices.
    Jabber/XMPP invited the Jingle Protocol for Jabber Applications.
    Google have included this in their Standalone app and the Plug-in for Web Browsers on both PCs and Mac (you can get this as a Standalone Plug-in or as part of Chrome)
    More on this here  This article has been changed several time in the recent months.  It now claims a greater involvement by Google in writing the Jingle Library (Although now Google's version does not work with the others)
    This tends to mean that using the web Login to Google to Chat also cannot video chat to other Jabber apps that are using Jingle.
    If your Buddy is using iChat then check the Video Menu has two items to Enable Camera/Video chat and Microphone/Audio chats are ticked.
    In the View Menu the Show Status Items should be ticked (Selecting them toggles the tick and the function On or Off)
    It could be Internet speed but at this stage I would doubt this at this stage.
    10:27 PM      Saturday; January 21, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • I have downloaded 2 free books and can't get them to work, I am on a macbook pro

    I have downloaded 2 free books and can't get them to work, I am on a macbook pro

    iOS devices only.

  • I just bought the BDP-S1500 yesterday and can not get it to work via wireless

    I just bought the BDP-S1500 yesterday and can not get it to work via wireless????

    Hi BigDaddy317,
    Please the link below for further assistance in connecting your wireless device to the internet.
    https://us.en.kb.sony.com/app/answers/detail/a_id/33377/p/47329,47564,95482/c/65,66/kw/internet
    https://us.en.kb.sony.com/app/answers/detail/a_id/35983/p/47329%2C47564%2C95482/c/65%2C66/kw/internet
    Please let us know if you're getting the same result or the error messages that you see.
    Thanks,
    >Joffrey
    If my post answers your question, please mark it as "Accept as Solution"

  • HT4108 I have a hdmi connector and can not get a picture to come on my tv. Need help also bought the RCA cables and can not get it to work with my iPhone 4 g

    I have a hdmi dock connector and can not get  it to show on my tv. It's a iPhone 4g please help also have a RCA cable to and can not get it to work either

    With what apps?  Not all apps require video output.

  • I just bought an ipad 2 and the iPad keyboard dock and can't get them to work.  What do I need to do?

    I just bought an iPad 2 and a iPad keyboard dock and can't get them to work together.  What do I need to do?

    Hello,
    You would need to pair the Apple Remote with the receiver. So I would use the generic Mac/PC receiver and follow these instructions:
    http://support.apple.com/kb/HT1619
    If that doesn't work then check in System Profiler to see if the IR receiver has been recognized by the PowerBook's hardware. You may require the install of drivers for this device to be recognized.
    Best of luck

  • I've installed it and can't get it to work

    I did the uninstall, reinstalled, checked settings, and can't get it to work.

    What is your operating system & version?
    What is your web browser?
    And what exactly means "can't get it to work"?

  • I purchase the Forms plus,  bywidgets.mu, and can't get it to work.  any help?

    I purchase the Forms + bywidgets.mu
    I've followed the directions on the weblink (https://widgets.mu/se/FormsPlus/demo/)
    and still can't get anything to work.
    I just keep getting <> inside a box and that's it.
    Help please!

    Hi Lisa,
    Do you have a URL where I can take a look at the issue? It may be a configuration issue or it may be a bug so I just want to check and make sure.
    In terms of the radio buttons one, I just published up update to the Forms+ Widget this morning that includes a new way to do grouping for radio buttons. Creative Cloud should download the updated version of the .mulib file into your downloads folder (and it should now be called something like FormsPlus Bundle.mulib), and you can double click that to add the updated widgets to your Muse library. The one I'm referring to in particular is called the "Radio Group (Box Selection)" widget. Basically, when you drag the widget out onto the page, it shows a dotted line box and you simply drag and resize the box around the radio items you'd like to group together. The box itself won't be exported so you don't have to worry about that, but it will allow you to visually group them instead of doing so with labels.
    Let me know if you have any trouble getting the new update or using the box selection widget and I'd be happy to help further.
    Thanks,
    Andrew

  • I have a new computer Window7 and can't get sharing for photos. If I reconnect to the old computer WindowsXP I can see photos. Is there a different setting in Window7?

    I recently purchased a new computer Window7 and no longer can find or share photos from my library. If I move back to the old computer WindowsXP I can share photos. Is there some setting that I'm missing on the new operating system that is preventing the sharing of photos?

    If you do not have access to the iTunes Library on your Old computer... or its Backup...
    See these 2 Links...
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991
    If you do have access... See Here...
    iTunes: How to move your music to a new computer
    Or...
    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751
    An Added Bonus is that you will have a Backup of iTunes.

Maybe you are looking for

  • Help Needed in AD Connection form Java Code

    Hi, I want to connect to AD target form my java program. We are doing this as we don't want to use the OOTB Connectors. How can any one connect to AD target from Java program? After connecting, How to Create a User in AD? Is there any API? Which one?

  • Itunes match renewed and lost all my music

    My itunes subscription automatically renewed on 10/6/13 and I have a reciept for the transaction.  Now all my music is missing.  This is really ******* me off.  I have so much music it will take forever to get it all back on my computer and then into

  • Error 1603 on ipad

    What is error 1603 while trying to restore ipad? It just stopped working and there is a picture of itunes and usb connector displayed?

  • Printing in Preview (pdf) in handout format

    How can I print in preview with handout format? 3 slides/page only filling half of page. This option is available in keynote but not preview. I really need this option for my biochem course. Help!

  • Apply a Payment to an Invoice via DI API

    Good day, I'm trying to apply a payment to an invoice through the DI API. All I did was follow the sample code in the included reference document but it gives me a runtime error "invalid cardcode". Any help would be appreciated. Thanks in advance!