OSX 10.4.10, Net beans and Sams Programing with JAVA

I am brand new to Java so I downloaded Net Beans on my MAC. I bought a copy of Teach Your Self Programing with Java in 24 hrs.
So far I got the first three programs to compile on Net Beans but got stuck when they started to talk about arguments. The following will not compile. Starting at line 2
1) System.out.println("The " + arguments [0]
2) + " " + arguments[1] + " fox "
3) + "jumped over the "
4) + arguments[2] + " dog. ")
I get the little red x on each line.
Is the book wrong or am I missing something?
All the tutorials talk about Javac. I can't seem to find it or get to it on my computer. How do I know if I even have it?
And is there such a thing as a "command line" on a MAC?

Hi, you should put any code you post in between code brackets like this:
  code here   I dont use a mac or netbeans but javac is the java compiler, you would not have been able to compile the first two. The .exe (or whatever mac executable is) is usually located in the lib folder in the java directory. It comes when you download JDK. As for the code, it would help me if you posted the first couple lines of the error message. It looks fine to me, but I would need to see your whole class in order to help you further
and yes there is a command line on a mac...i think its called terminal and usually looks like a little computer
Edited by: jaredL on Sep 20, 2007 7:45 PM
Edited by: jaredL on Sep 20, 2007 7:47 PM

Similar Messages

  • What do you think of this book: "Programming and Problem Solving with Java"

    Hello Everyone:
    This may be a strange post but I am wondering if anyone has read this book and what do you think of it?
    Book Information
    Title: Programming and Problem Solving with Java
    Authors: Neell Dale, Chip Weens, Mark Headington
    Publisher: Jones & Bartlett
    Thanks for any comments

    No believe me the book is bad! The only reason I asked is I am in a university class that uses those two books for there course. The author messed up on HelloWorld.java with 4 errors at compile time! How can anyone be that stupid since they are the ones who are supposed to be teaching me the fundamentals of Java. Anyhow I just wanted other people's thoughts about the books.
    Thanks again for your input.

  • Is it possible to play .rm and .wma file with java?

    Hello Friends,
    Please tell me,
    how to play .rm and .wma file with java?
    Thanks,
    Harsh Modha

    As far as I know, you can not play those files.
    Here you have the complete list of supported formats. Hope this helps.
    http://java.sun.com/products/java-media/jmf/2.1.1/formats.html
    Maybe you should try to convert from wma or rm to a supported format before attempting to play it.

  • Net Beans and JDBC Problem

    Hi everybody, I am able to compile and run a program that uses the JDBC withing the Netbeans environment.(I developed the application within that ide). However after building the project, if i try to run it from the command prompt or from windows it does not work . If i run it from the command prompt, I get this error message below. What do I need to do to be able to run the program outside the environment.
    C:\>java -jar "D:\FinalProject\FinalProject\dist\FinalProject.jar"
    Exception in thread "main" java.lang.NoClassDefFoundError: com/mysql/jdbc/Driver
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at utilitly.DBConnectAndUtilities.<init>(DBConnectAndUtilities.java:50)
    at gui.mpisGui.<init>(mpisGui.java:23)
    at finalproject.Main.createAndShowGui(Main.java:24)
    at finalproject.Main.main(Main.java:35)
    below is the code i use for the database linking and interaction.
    import java.awt.Component;
    import java.awt.event.ActionListener;
    import java.sql.*;
    import java.text.DateFormat;
    import java.text.NumberFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.swing.JFrame;
    import javax.swing.Timer;
    import java.util.Vector;
    import javax.swing.JComboBox;
    import javax.swing.JFormattedTextField;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JTextPane;
    import javax.swing.text.MaskFormatter;
    * @author Morrizle
    public class DBConnectAndUtilities{
    /**declare a connection that would be used*/
    private Connection dbcon;
    private Statement dbstmt;
    private ResultSet dbset;
    private String dbName = "mpisdb";
    private String patient_pers_info = "patient_pers_info";
    * Creates a new instance of DBConnectAndUtilities
    public DBConnectAndUtilities() {
    //this.dbName = dbName;
    /*load the driver and make a active connection/
    try{
    /*load driver*/
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    /*get an active connection*/
    dbcon = DriverManager.getConnection("jdbc:mysql://localhost/" + dbName , "root","morrfo");
    /*create a statement with which we can execute the update of database*/
         dbstmt = dbcon.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    /*prints the following if the connection is succesfully made with the database*/
    //System.out.println("Connection made");
    catch(Exception m){
    /*prints the trace of errors if the connection or loading of driver doesn't work*/
    m.printStackTrace();
    /*methods to update the database and tables
    returns true when the update is successful **/
    public boolean updateDB(String tableNValues){
         /*execute*/
    boolean result = false;
         try{
         dbstmt.executeUpdate(tableNValues);
    result = true;
         }catch(SQLException k){
              k.printStackTrace();
    return result;
    /*method to execute queries*/
    public ResultSet queryDB(String query){
              ResultSet m = null;
         try{
              m = dbstmt.executeQuery(query);
         }catch(SQLException q){
              q.printStackTrace();
         return m;
    /*method to close the connection*/
    public void closeConnection(){
    try {
    dbcon.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    public void closeStatement(){
    try {
    dbstmt.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    /*a utility method to return a varchar object as a string*/
    /* method to convert a string to varchar*/
    public String toVarchar(String convert){
    String converter = "";
    if(convert.isEmpty()){
    converter = null;
    }else{
    converter = "'"+ convert +"'";
    return converter;
    Please come to my aid . Please.!!!!!!!!!!!!!!!!! i need urgent help

    Please reference the following thread.
    http://forum.java.sun.com/thread.jspa?threadID=5177116&tstart=0

  • Spawn Unix Process in same shell with Java

    Hello,
    Does anyone know how to use java to prompt the user for input, execute their command, wait for the command to finish and then prompt them again.
    I am able to prompt the user for input, but if they type 'vi filename' and I execute it, the user never sees the vi screen to edit the file. I would like to be able to allow other programs like 'vi' to use the same command line terminal that the user is currently in with java. Currently executing any command is fine, and I can read the process i/o. The only problem is when a program like 'vi' needs the terminal. Does java prevent that from happening when spawning a process?
    Thanks,
    Rick

    Should this be command line based? There are several graphical java terminal emulators, here's an open source one for instance:
    http://javassh.org/wiki-view?oid=5F8180808080808080808080808086neotis

  • Compliabiality of DOT NET Graphical User Interfaces (GUI) with Java

    Hello,
    At present i'm about to start learning GUI's in Java.
    I've acquired all the basic knowledge regarding Java enough to be able to learn GUI's.
    My Questions are:
    1) To begin with Learning Java GUI's, is it really necessary to learn AWT before learning Java Swing Framework ??
    2) I heard that VISUAL STUDIO of Dot Net Framework Supports advanced GUI facilities and Rich look than Java Gui's does, So can we use .Net GUI library classes to build GUI's which have to run in Java Applications???
    Also is it really true???

    Tejaswi.B wrote:
    ..is it really necessary to learn AWT before learning Java Swing Framework ??No, but note there are many (non component) parts of AWT that might be used in Swing interfaces. Fonts, Dimensions, layouts, ..
    Having said that, follow the link Darryl provided and you'll find the tutorial covers those classes (almost) as if they were Swing.
    2) I heard that VISUAL STUDIO of Dot Net Framework Supports advanced GUI facilities and Rich look than Java Gui's does, ..Where did you hear that?
    As far as I understand, there are a few components provided in .NET that are not in Swing, such as (I'm not sure what it is called) a 'switch list' where there are two lists side by side with buttons to move items from one list to the other. These components can be made from other components in Swing. I guess the Swing developers felt those components were too infrequently required to justify adding a specific component for them.
    You might also want to check out SwingX (https://swingx.dev.java.net/), which is built on Swing to provide extra components.

  • How to do a program with java user intarface (internet app) and c++ core

    I want to do a program to run on the internet with java
    but to run the mathematical core with c++ on a SUN machine.
    so, any help will be cool!, any tip about this subjet
    will be apreciate!
    my mail is [email protected]
    and [email protected]
    I am doing a Phd on electronics and i want to do
    a circuit simuilator online.
    thanks!

    One option is to use Java Native Interface (JNI).
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

  • Parallel execution of same program with different parameters.

    Is it possible to start the same plsql routine parellelly from PLSQL.
    Begin
    prog1 1 1000
    prog1 1001 2000
    prog1 2001 3000
    End;
    I mean to say something like in Unix where in you can
    prog1 1 1000 &
    prog1 1001 2000 &
    prog1 2001 3000 &
    Thanks.

    There are two methods in Oracle. DBMS_JOB and DBMS_SCHEDULER. These are APIs that allows you to create background PL/SQL processes.
    Details on both APIs are in the [url http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/toc.htm]Oracle® Database PL/SQL Packages and Types Reference guide.
    Example (using DBMS_JOB):
    declare
    jobID number; -- job ID returned by DBMS_JOB for scheduled job
    begin
    -- schedule 3 jobs for starting at SYSDATE, as once off jobs as we
    -- do not specify any interval
    DBMS_JOB.Submit( jobID, 'prog1 1 1000;,' SYSDATE );
    DBMS_JOB.Submit( jobID, 'prog1 1001 2000;,' SYSDATE );
    DBMS_JOB.Submit( jobID, 'prog1 2000 3000;,' SYSDATE );
    -- only when these job submissions are committed, will the job queue
    -- processing pool see these jobs
    commit;
    end;

  • Slow, not responding, and not compatible with java etc since updating to 6.0.2. Love Firefox normally but am not happy.

    Since updating to Firefox 6.0.2 i have not been happy with the way it is running. It is incredibly slow, keeps telling me its 'not responding' and looking at my add-ons, seems incompatible with the java console, with skype click to call, etc. I also seem unable to look at complex 3d graphics online, which used to work fine. Now they end up crashing the system.
    This is a big problem for me, and i have noticed (on your other forums on this website) that others are having similar problems.
    Is there any thing i can do before this problem is eventually fixed by firefox?

    i tried. like i said, only when i disable all i can watch youtube. i have not checked settings of extensions but i am not an it specialist. i probably would not know what to look for.

  • Windows and Mac hostnames with Java.

    Hi,
    I'm not sure if this is the correct board or not for this, but I'm really getting frustrated, and I'm sure it's something easy for someone who knows.
    Anyway.. I'm working on some Java software for school, and I'm trying to get the program to run on my 2 machines (one is the MBP, and the other is a windows XP pc), but I'm having trouble having trouble finding one machine from the other (in either direction) because neither can seem to find the hostname of the other.
    On my Mac, from the Sharing panel I have set my local hostname to david.local. On my windows box, my hostname is david. I can ping myself on each machine, but when I try to hit the other, the hostname can't be found.
    Please help me figure this out. I know it has something to do with the naming, because I gotten this to work a couple of years ago for another project. Only.. it's been a while and I hadn't had to do it since then, so I've forgotten what I had to do back then to get it working.
    Any help with be greatly appreciated!
    David

    Hi Rick,
    I changed the Mac so it would be on Mshome (yes, I left it as the default in windows.. lol.)
    Rebooted both.. no dice.
    A question about this though.. can I still connect to other networks? I take my computer to school, and I have never had to change this before, and everything had worked smoothly.
    Oh! That reminds me. I can connect to shared folders on my Windows machine from my Mac with the Connect to Server from Finder. I do smb://david/<shared folder> and it all worked out just fine, without the workgroup being set. (Still works now, btw)
    Thanks,

  • HT202912 How do I remove Java 1.7 and replace this with Java 1.6.0_65?

    I need to get back to  an older JRE specifically Java 1.6.0_65. Right now I have Java 1.7.-_71-b14.
    I've tried the instruction in the terminal - sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    That doesn't work. In Terminal mode, a "java -version" query returns the same "Java 1.7..." indicating it has not been removed. What else do I have to do here ?
    Thanks

    I need to get back to  an older JRE specifically Java 1.6.0_65. Right now I have Java 1.7.-_71-b14.
    I've tried the instruction in the terminal - sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    That doesn't work. In Terminal mode, a "java -version" query returns the same "Java 1.7..." indicating it has not been removed. What else do I have to do here ?
    Thanks

  • Opening file to automatica​lly open and run program with input file

    My program has the ability to save and open a text file with a custom extension.  How do I make the system in which the program is being installed to recognize this file to open the program, AND how to I gather the input file in my program and load it.
    Thanks
    Solved!
    Go to Solution.

    Ok I have found on a different thread how to setup/register the file path association in the classes root.  What I don't understand is how my program will know what the input file is.  For example, the reg setting is C:/.../MyProgram.exe %1
    When my program loads, is the %1 in the argc/argv part of the main thread? And if so, how do I debug/test this?
    Thanks

  • I wanna buy apple macbook air MD711HN/A 11-inch.im a programmer and i wanna to run Xcode on this.is this model can run xcode and other programming languages java,c,c  ,objective c on xcode etc.....is it model useful for programmer?

    Apple MacBook Air MD711HN/A 11-Inch configurations:4 GB RAM,128 GB SSD,intel core i5 4th Generation and Mac OS X Mavericks Lion.and im from india so this model is indian Mac

    Hi dnisarg13,
    Yes, Xcode will run on a MacBook Air will Mavericks. You can find compatability details and Apple Developer Support informaiton on the Mac App Store link below.
    Mac App Store - Xcode
    https://itunes.apple.com/in/app/xcode/id497799835?mt=12
    Compatibility: OS X 10.8.4 or later
    -Jason

  • Checkin and checkout view with java

    I went through the waveset API and I am trying to checkin and check out view/object.....I found a method which does it but im not sure what would the String id would be in the following method.
    checkoutView(ViewMaster vm, java.lang.String id, java.util.Map options)
    Here is what I have so far
    Session ses = SessionFactory.getConfiguratorSession("http://127.0.0.1:8080/FIM/servlet/rpcrouter2",username,pass,false);
    LighthouseContext lh = ses;
    AbstractViewHandler avh = null;
    ViewMaster vm = new ViewMaster(lh);
    HashMap m = new HashMap();
    GenericObject go = null;
    go = avh.checkoutView(vm,String id, m);another way of checking out the object is throught LighthouseContext
    but even there it requires a String id
    I tried doing:
    Session ses = SessionFactory.getConfiguratorSession("http://127.0.0.1:8080/FIM/servlet/rpcrouter2",username,pass,false);
    LighthouseContext lh = ses;
    HashMap m = new HashMap();
    lh.getView("configurator", m);i got a following error:
    com.waveset.util.WavesetException: Server exception: com.waveset.util.InternalError: Unable to locate view handler for 'configurator'
         at com.waveset.session.RemoteSession.getResultObject(RemoteSession.java:1076)
         at com.waveset.session.RemoteSession.rpc(RemoteSession.java:1027)
         at com.waveset.session.RemoteSession.callx(RemoteSession.java:955)
         at com.waveset.session.RemoteSession.call(RemoteSession.java:939)
         at com.waveset.session.RemoteSession.call(RemoteSession.java:925)
         at com.waveset.session.RemoteSession.call(RemoteSession.java:912)
         at com.waveset.session.RemoteSession.call(RemoteSession.java:901)
         at com.waveset.session.RemoteSession.getView(RemoteSession.java:799)
         at Test.main(Test.java:29)
    thx
    Edited by: djavia on Nov 6, 2007 6:51 AM

    The format for the id parameter is <ViewName>:<ObjectName>.
    eg, 'User:configurator'.
    Michael.

  • Reading and generate IDocs with Java

    Hello guys,
    I need to develop an application that transform IDocs to XML and XML to IDocs, doing modifications like sum on some fields (by a metadata file).
    Can anyone help me to find how I can do that?
    Regards,
    Julio Sardella

    Thank you guys, but that didn't helped me so much.
    I've forgot to say that my application has to be a stand-alone app that convert xml to idoc and vice-versa but outside the SAP environment. It's kinda robot app. It's just convert the files and trasnfer to the both sides (DI and a private app).
    Sorry for the low level of information.
    Regards,

Maybe you are looking for

  • How can I get audio to play from my TV when using hdmi cable?  Video looks great, just no sound.

    How can I get audio to play from my TV when using hdmi cable?  Video looks great, just no sound. I've tried plugging the hdmi into the TV directly and the receiver. I get video every time.  HBO to Go , Xfinity, ABC, Youtube, etc... just no audio.  An

  • Multiple users on single computer

    We're helping a church train their volunteers to use Contribute. In their small computer lab, volunteers will edit their particular directories/pages. We can easily create keys for each of them with their specific allowed directories - can multiple u

  • Why are dots missing from PDF output?

    When I use the 'line' tool with dots, (in this case to draw a line-break,) AND export a .pdf, it often leaves out a single dot in the line. There are no objects intersecting the line, or even within a half-inch of its location. The missing dot is con

  • Send an output with dispath time 3, from an external report.

    Hi, It would be very appreciated if someone could help us with the following question:    We have an output message in a shipment which print a form.    This output is defined with dispatch time 3 ‘Send with application own transaction’.    Then we h

  • GMS and Windows Phones error 80072F7D

    Hello, after expiration of old SSL certificates we added wildcard certificate from RapidSSL. iPhones and Android phones are happy with that, but all MS Phones getting 80072F7D error, when trying to sync with GMS. We imported SSL certificate from GMS