Results 1 to 2 of 2
  1. #1
    PHM
    PHM is offline Member
    Join Date
    Mar 2014
    Posts
    2
    Rep Power
    0

    Default Having trouble getting Java to compile on Mac OS X 10.9.2

    So for my object oriented programming class we are closing with some java.

    This is my version:
    java version "1.8.0"
    Java(TM) SE Runtime Environment (build 1.8.0-b132)
    Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

    I am having trouble running basic example projects that my teacher has provided us. It seems like everything in the project is an error. For example...



    // HelloWorld Example
    // Source code file HelloWorld.java
    // The traditional HelloWorld application.

    public class HelloWorld
    {
    public static void main(String[ ] args)
    {
    System.out.println("Hello, World!");
    }
    }



    Gives me this when I compile it:

    HelloWorld PHM$ javac hello-world.java
    hello-world.java:1: error: illegal character: '\ufeff'
    // HelloWorld Example
    ^
    1 error

    So I removed the comments and...



    HelloWorld PHM$ javac hello-world.java
    hello-world.java:1: error: illegal character: '\ufeff'
    public class HelloWorld
    ^
    1 error



    I have tried retyping my code cause it was copied and pasted. Didn't work. I have tried uninstalling and reinstalling JDK 7 and JDK 8. I have also gotten this error on every example project that our teacher provided us. Can someone please help me! I don't know what to do anymore

  2. #2
    PHM
    PHM is offline Member
    Join Date
    Mar 2014
    Posts
    2
    Rep Power
    0

    Default Re: Having trouble getting Java to compile on Mac OS X 10.9.2

    I'm also getting this:

    PHM$ java -javaagent
    Unrecognized option: -javaagent
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.

Similar Threads

  1. Replies: 5
    Last Post: 03-26-2012, 08:11 PM
  2. Replies: 3
    Last Post: 02-03-2012, 09:52 PM
  3. Replies: 13
    Last Post: 06-29-2011, 08:25 AM
  4. .java won't compile
    By paul21 in forum New To Java
    Replies: 4
    Last Post: 03-30-2010, 07:58 AM
  5. Compile Trouble
    By adelgado0723 in forum New To Java
    Replies: 5
    Last Post: 04-21-2008, 03:02 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •