Java programing in XCODE 3.0

Hi
Im new to JAVA programming so i guess my question is pretty basic. I just upgraded to XCODE 3.0 and now I have trouble debugging and running the simple code i write. Previosly I used XCODE 2.4 and had no trouble there. Is there anyone of you that know a setting you would recommend for XCODE 3.0. Again, I do very , very basic code so far.
Thx

if you are using very very basic java coding, then why not just compile it on a Terminal and use a simple text editor?
XCode is apple specific and it involves many tools and environments. Asking them on their list would get better response.

Similar Messages

  • Hw do  u run java programs in xcode 4?

    hw do  u run java programs in xcode 4?
    pls tell the detailed steps fr running a java program

    Here is a document dated 2009: Introduction to Jar Bundler User Guide - Apple Developer
    ...I don't think JB is included now.

  • How to execute java programs in xcode

    I cannot execute Java program in XCode for Mountain Lion 10.8.2. Please help me how to execute a Java program.

    Do you have a particular error or message or diagnostic or issue, or something that's particularly wrong with Xcode?  If installed, Java does work, and Java applications can be invoked.
    Background: Java was deprecated from OS X a while back, and Java itself was removed from the default OS X 10.8 installation.
    Given that Java is now an add-on for OS X, you'll want to check with Oracle — the owner of Java — for OS X kits and tools.
    I don't know off-hand if Xcode still particularly supports Java (it was pretty weak, when last I checked), but I'd expect you'll be using makefiles for the work, and I'd also suspect that whatever Java support remains in Xcode will probably be going away in some future version of Xcode.   (If support hasn't already disappeared.  You may be using bash build scripts and makefiles to deal with Java now, or going forward.)
    If you don't have access to the Apple developer forums and the discussions of tools available there, then the archives of the Apple Java-Dev mailing list can be a good spot to look for existing discussions, and to post questions related to Java development on OS X.
    As for IDEs other than Xcode,  Eclipse or NetBeans or IntelliJ IDEA, and BlueJ all run on OS X, and any of these would probably be a better long-term choices for Java development on OS X.

  • Can I write and run simple java programs in Xcode

    I need to write and run basic java programs on my mac. I would like to run it in Xcode, but I don't know how to set it up? Is there a way?

    Read the following discussion from last month on here:
    Can Xcode 4.5.1 compile/run java?

  • Java Programming in Xcode

    First I want to apologize for some that they thing this question is a repeat.
    However I do need seriously help with using Xcode tool for programming. Moving on, I have made many searches online how do you use Xcode Tool for Java. As you may all already asked this question before and I have marked solved, but it was not. One guy suggest that I should use netbeans, Eclipse, and etc. however I do not want to use any other I.D.E.'s to do some programming at all.
    Alright, I'm in college and I am taking Advanced Java. It is all going well, but I want to learn it on Xcode, but I do not know how to. I need some guidance how to use it properly and run application that I developed in Java Language. I already have went to: File ====> New Project ====> Java ====> Java tool.
    Then I go to src folder and edit out the Java File inside that folder to build my Java file. Okay, after that I type my codes in and i click Build and go. Nothing happens at all. It just says program executed and blah blah blah.
    So I know there is someone out there who already know his/her way around xcode and could guide me through this!!!
    Oh! I use xcode 3.1.2(If that helps!)
    Thank you to all(In Advance)
    -Raja CPatel

    Raja CPatel wrote:
    Okay, you have to guide me to that path mate!
    I'm kinda lost and confused!
    Was talking to the other person using SL, not you...
    Raja CPatel wrote:
    i've tried all the template too and when it comes to build and go, nothing pops of the screen mate
    When selecting a template, choose:
    • Java Applet
    Make no changes except to 'Release' - top left pull-down in the main Xcode window. Click 'Build & Go'.
    The 'jar' file will be in the project folder/dist folder...
    You can control-click on the target name on the left and choose 'reveal in finder'...
    A new window should open on your computer that says 'Hello World'.
    If this doesn't occur, your JAVA install is most likely borked. If you're looking to upgrade, I recommend to upgrade to SL if possible.
    Please update your profile info to show the OS you are currently using as well, thanks.

  • Cannot run java program after archive and install

    Hi,
    I am new to this forum and appreciate the help and advice given here.
    Yesterday, I did an archive and install on my system which install 10.4.3. Afterwards, I installed X11 and did the software updates which brought my system back to 10.4.8. It also installed Java 1.3.1, 1.4.2, and 1.5 (J2SE5).
    Prior to the archive and install, I had no problems executing a java program either in the command line in an X11 window or using Eclipse. However, when I try now I get the exception message "Exception in thread "main" java.lang.NoClassDefFoundError:". I checked my CLASSPATH and it's not the problem. I am able to compile, and execute the javadoc command. If I type java -version I get
    java version "1.5.0_06"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
    Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)
    Under Eclipse, I am able to see the Java versions under Preferences - Java - Installed JREs but if I go to the Run -> Run As menu, I see (none applicable).
    Thanks for any suggestions to fix this.
    James
    Dual 867MHz G4   Mac OS X (10.4.8)  

    I resolved the issue. I reinstalled XCode and had an issue with one of the files I was testing.

  • Newbie help: learning programming on xcode

    Hi all!
    I'd like to start learning programming either in java as well as in C using my mac. So i've downloaded Xcode on my PB g4 10.3.9.
    I know there's a lot of tutorials online on java and C, and that's fine. The hardest thing, that i really cannot solve by myself alone, it is figuering out how to manage all files that I need to use for programming on Xcode.
    My question is:
    Is there a book somewhere, on amazon or free or wherever, where i can find a tutorial explaining step by step programming java or C using Xcode?
    So i can learn the programming tips and also how to manage them on Xcode, using my mac.
    Thank you for the attention
    Tom
    power book g4   Mac OS X (10.3.9)  

    C is a good first language because many other languages are based on it or similar. There's lots to learn with "just text," meaning applications that don't have buttons and windows and graphical user interface items. You learn about variables, constants, arrays, loops, conditionals, functions, pointers, data types, recursion, algorithms like searching and sorting, etc.
    You also might find a community college class or some other class that teaches beginning programming.
    The next thing to learn is some object oriented programming. C is not an object oriented language. Java, C++, and Objective-C are object oriented languages. Objects are are things that have instance variables (variables like ints or doubles or whatever that are inside the object and not so accessible to the rest of the program) and methods (functions that just work for that kind of object.)
    You might ask, well why not learn an object oriented language to begin with? You can, but it may be easier to learn basic stuff in a language like C first. Both C++ and Objective-C are supersets of C, meaning they include all of C and add some more. Java is very C like and adds more.
    If you're heading towards writing mac programs using Cocoa, Objective-C is good to learn because it is the most natural language for writing Cocoa programs.
    Then you can get a Cocoa book, like the one by Aaron Hillegass and learn about Cocoa. Cocoa includes buttons and windows and is not "just text."
    After you have learned so much about a computer language or two or three, it may be surprising that an API (application programming interface) like Cocoa is way bigger! No one can memorize it all. So you look stuff up in the documentation and search the internet and make little experiments to figure things out.

  • File access in a Java project under XCode

    Hello again,
    I have had another issue: I'm trying to have one of my classes read information from an XML file, whose location is in the same folder as the classes and, indeed, the project (and the .xcodeproj file).
    So I give the file's name to the method, but it cannot seem to find the file where I put it; instead, it looks for it in (Project folder)/Build/Debug/.
    What should I do? I do not feel it wise to put it into Build/Debug as it is a file that should be deployed along with the rest of the application (when I learn how to make one, that is), but after a little searching around I'm a bit at a loss about that.
    Thanks in advance,

    This option is normally used for storing preference
    files. If you have a number of files then you can
    create a folder to hold them. If you have a look
    around at the files which are already there (for
    other applications) you'll get the idea.
    Well, preference files are fine but I don't view them as useful for data.
    This folder
    is strictly OS X only, but I'll explain there's a way
    around that later on.
    I failed to catch that explanation, but you might want to leave it at that. No high priority as far as I'm concerned. (Of course, it could be of interest to anyone who finds this discussion - why else are we using a forum, right?)
    You can create a bundle from a Java program using
    Macintosh HD/Developer/Applications/Java Tools/Jar
    Bunder. Again, this is OS X only.
    Again, good to know, but not usable now by this developer.
    If your program relies on a number files (for example
    jpg files for graphics and wav files for sounds) then
    these can be added to the jar file. Xcode will do
    this for you if you add the file to the project, then
    drag it onto the Build Java Resources build phase.
    This form of words will extract the file called
    stars.jpg from the jar file:
    URL f = getClass ().getResource ("stars.jpg");
    image = ImageIO.read (f);
    Interesting, but the software I'm using as a model of sorts (as far as general design goes from a user point of view) seems to have little in the jar file besides classes. I'd like sufficiently advanced users to be able to access the data files directly (I'll make them nice XML files) but not get into the .jar. Tell you what, I just stumbled on the XML reading class and it seems to be using File.getAbsolutePath(). I must try this.
    This works on all Java platforms and so is often
    used. There is a standard Unix/Terminal command
    called jar which gives you fine control over a jar
    file. Type man jar in Terminal for details and more
    info about jar files.
    Thanks.
    6) You think you never mentioned a sixth option?
    Well, you did - in that other topic you answered.
    You
    gave me the idea of fiddling with project
    settings.
    Be aflaid, be vely aflaid! I have tried to use
    $(PROJECT_DIR) instead of $(inherited) in "Build
    Products Path" and "Per-configuration Build
    Products
    Path", but so far to no avail: running throws a
    "LaunchRunner Error" = "The main class
    "Main_Class"
    could not be found."
    These are Xcode options and probably won't be of much
    value to you.
    Well, they are. But I suddenly realize it may work fine and well while in debug, but not so well once everything is compiled and set into a nice application. I'll try this.
    BTW. Did you know that a Java program can find out
    which platform it's running on? Just call String
    opSys = System.getProperty ("os.name");
    This enables you to use different solutions for each
    different platform.
    Actually, I knew about System.getProperty. I've been trying to use it to imitate the Application.Path property from Visual Basic (the language I use most at work), that returns the current location of the application. Does there exist something like that in Java? I've tried System.getProperty with "user.dir", "java.home" and "java.class.path", to no avail: the first gives me Build/Debug (or Build/Release, depending on the build configuration), the second returns the place where you can find Java, in the System/Library structure, and the third yields a looooong path list.
    (Still, might be onto something with that File.getAbsolutePath() thingie. I really have to try it.)
    Thanks again for the elaboration, helpful as usual and rightly clicked so.
    iMac Mac OS X (10.4.8)

  • Error while running a Java Program

    Can anyone help me,
    I am getting the following error while running a Java program, Below is the exception thrown, please help.
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RESummer1.run(RESummer1.java:505)
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RECollectCont.run(RECollectCont.java:304)

    Ok, let's see. Write the following class:
    public class Grunt {
      public static void main(String[] args) {
        System.out.println("Hello Mars");
    }Save it as "C:\Grunt.java", compile by typing:
    javac c:\Grunt.javaRun by typing:
    java -classpath "C:\" GruntDoes it say "Hello Mars"? If yes, go back to your program and compare for differences (maybe you used the "package" statement?).
    Regards

  • Running a java program a set number of times

    This is a general question. Is it possible to make a java program run only 5 times for the sake of arguement.
    Basically I want to write a program that will give the user some flexibility when it will actually run another Java program, but I only want them to be able to say "not now' for a set number of times. When the last time comes the other program will launch. I was initially thinking of the Do Whilw loop, but this needs to work when the program is restarted.
    Program starts, it has 5 times it will run before it does something else(doesn't really matter now I think). User takes option "Not Now" and the program ends, but warns the user this will run 4 more times before you will need to do something.
    This process will repeat until the user takes the option "Ok install now" or the time limit expires and the install occurs anyway. Can someone point me in the right direction.

    ok I see so it's like one those programs that you download for free on the internet and they give you a set amount times to use it before you have to pay for it. but in this case when the number of times you use it equals 5 (or when the user clicks ok) a different java app will open automatically.
    My first thought would be to Write a Serialized object to disk using objectOutputStream that stores the number of times the application has been opened. and each time the program runs it checks for the serialized object and then you can do something like what I posted before. of course if were worried about security the user could always look for the object and erase it, if so then I guess we would have to come up with another plan of attack
    Hope this helps

  • Running a java program

    This shows how dumb i am.
    I have a java program all wrote. How can i run it without using the compiler? Can i have a .exe file or something that I just have to click on to run??
    Thanks again
    Agdude

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\awaguespack>cd jbproject\untitled1\classes\untitled1
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>java
    form
    Exception in thread "main" java.lang.NoClassDefFoundError: form (wrong name: unt
    itled1/form)
    at java.lang.ClassLoader.defineClass0(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$100(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)
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>dir
    Volume in drive C has no label.
    Volume Serial Number is C065-81CA
    Directory of C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\
    untitled1
    07/24/2003 02:21 PM <DIR> .
    07/24/2003 02:21 PM <DIR> ..
    07/24/2003 02:21 PM 7,655 form.class
    1 File(s) 7,655 bytes
    2 Dir(s) 36,031,016,960 bytes free
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>echo
    %classpath%
    %classpath%
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>

  • Running a java program at "Start Up"

    Besides running an html file with an applet in it. Are there any simple ways to launch a java program every time the computer is turned on.
    I am not asking for specific directions, but rather just an idea, and i will go find my own guide.

    Well two ideas (if ur on windows) u could try are -
    one, if you had a class file you could simply create a
    batch file on windows that says java <class> and then
    put that batch file in your startup so that the class
    is run at startup or else you could think of modifying
    the registry keys on windows to run this class at
    startup - whichever works for you.Or you could just jar the program up, adding a Main-Class indicator in the manifest, and then add a shortcut to the jar to the startup folder, as someone else stated. Theres little need to go messing around with DOS batch in modern windows.

  • Running a java program from an icon

    I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
    Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?

    Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
    not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE?

  • Running a java program via a batch file

    I am unable to run a java program from a batch file that I created.
    spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.What should I do to get the output?
    echo ^<html^>^<body^>
    echo hello^<br^>
    call java spiderpackage.EntryPoint -v
    echo ^</body^>^</html^>

    This has nothing to do with java programming. Have a look at the windows help for the call command.
    The echo <html> stuff doesn't make sense. What's it for?
    The command in you batch file should be:
    java -cp . spiderpackage.EntryPoint -v
    assuming that java is in the system path, and the EntryPoint.class is in a directory called spiderpackage which is a subdirectory of your current working directory

  • Running a Java program at startup in Linux

    Hello
    How do I run a Java program at startup in Linux? I know in Windows I can put a .bat file in C:\Windows\Start Menu\Programs\StartUp\ directory, but in Linux I have no idea how it is done.
    Thank you,
    Mihai

    This is really a Linux question, not Java.
    And then it depends on the version of Linux you are using.
    Maybe this will help, otherwise you should try on a forum for your version of Linux.

Maybe you are looking for

  • Weather icon wont find local weather

    my local weather will not update on the weather app.

  • Problems trying to open a Pages document

    Have been working on a document on my ipad for a few days now and now can not open the document. I can see the preview of the document, I can duplicate the document (and can not open the duplicate either) but I cannot export or email the document in

  • Sun LDAP with Solaris

    Hi All, i have very simple and short query, Is Sun Directory comes bundled with Solaris 10 ? or we need to download explicitely. If we download that is a free version or we need to procure. Thanks Avninder

  • Can't import .tif file

    iPhoto won't import a large tiff file of a pano, one about 50K x 3K pixels, 852MB. Wondering if the problem is that it's a tiff, or the file size, or the megapixel count, or something else? It was saved in photoshop with no image compression, 'interl

  • I get aq run time error when trying to load the latest version of iTunes. Help.

    I get a run time error when attempting to install the latest version of iTunes & now cannot access iTunes. Can anyone help me?