Java Question

Discussion in 'General Mac Discussion' started by JLaFrance, Sep 17, 2004.

  1. JLaFrance macrumors member

    Joined:
    May 24, 2004
    #1
    I've got Mac OS 10.3.5 and I've been told that the "Java enviroment" came with OSX, but I don't know wher it is or how to set it up. Any help?



    Thanks
     
  2. earthtoandy macrumors 6502

    Joined:
    Jan 18, 2003
    #2
    what are you trying to do?

    The java virtual machine and all is bundled with the OS...meaning you dont have to do anything. Java programs will run on your computer
     
  3. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #3
    Why worry about where it is or how to set it up when it just works right from the start? Much better than Windows, don't you think? You use it just like any other Java environment. The javac and java commands are used to compile and run Java programs from the command line, or you can write Java code in Apple's free development tools - Xcode.
     
  4. JLaFrance thread starter macrumors member

    Joined:
    May 24, 2004
  5. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    You should download and install the most recent Java update from Apple, then try again.
     
  6. cubist macrumors 68020

    Joined:
    Jul 4, 2002
    Location:
    Muncie, Indiana
    #6
    What do you mean "jar files don't open"? (1) If you double-click on them in Finder, they will run. (2) If you are in terminal, use "java -jar jarfile.jar" to run them. For character-mode java apps, you must run them in terminal using the second method.
     
  7. JLaFrance thread starter macrumors member

    Joined:
    May 24, 2004
    #7

    No, they don't

    "Invalid or corrupt jarfile /Users/John/Desktop/JavaMBS/Code/mbsbb.jar"
     
  8. zv470 macrumors 6502

    Joined:
    Jul 4, 2004
    Location:
    New Zealand
    #8
    if you want to know where it is type "which java" in the terminal, this works with "which perl" etc... etc... aswell. Download Eclipse from eclipse.org its a prettie good IDE... but make sure you download the SDK version (thats the one that comes with all the Eclipse java stuff you need).
     
  9. JLaFrance thread starter macrumors member

    Joined:
    May 24, 2004
    #9
    I cant open ANY .jar files!! they are all either corrupt of invalid, i need to open these for school.
     
  10. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #10
    Like I said earlier, try installing the Java Update to fix a corrupt Java environment, which is what I think you have.
     
  11. starrin macrumors member

    Joined:
    Aug 22, 2004
    #11
    Okay -- so firts off I am not sure when you say jar files do not open -- do you mean from the ui environment -- in other words have you tried to open them with something like StuffIt?

    Secondly - the JRE is located in the /Library/Java/Extensions/Home

    which has links to the latest commands 1.4.2 I believe -- now if you need a different version for an IDE or something -- you need to install it and then place that installation in your PATH first - does not hurt to set a JAVA_HOME env. variable either.
     
  12. jeremy.king macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #12

    Not all .jar files are executable. The class to run on launch will be defined in the manifest file.

    You should also try to run them in terminal with the command

    java -jar somejar.jar [args]

    For example.

    java -jar helloworld.jar
     

Share This Page