Java 7

Discussion in 'Bukkit Help' started by Epitastic, Jul 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Epitastic

    Hello everyone.
    I'm developing a server on my computer and am eventually going to release it onto a real server, but I am getting an error and I know why I am getting it and I was wondering HOW I could fix it. I am getting the following error:
    I have done some research and found out that it is because I am using Java 7 plugins but I am running my server on Java 6. While searching I have been unable to find a solution to my problem. Please note that I am on Mac OSX.

    My start_server.command is:
     
  2. Offline

    rylinaux

    This happens when you use code that isn't compatible with Java 6. You need to check for things such as lists using diamond operators, multiple exceptions being caught in a single catch statement, etc.

    For example, the following is acceptable in Java 7:
    Code:java
    1. ArrayList<String> list = new ArrayList<>();
    2.  
    3. try {
    4. blah();
    5. e.printStackTrace();
    6. }

    But for Java 6, it would have to be adjusted to the following:
    Code:java
    1. ArrayList<String> list = new ArrayList<String>();
    2.  
    3. try {
    4. blah();
    5. } catch (NumberFormatException e) {
    6. e.printStackTrace();
    7. } catch (IOException e) {
    8. e.printStackTrace();
    9. }
    10.  

    If you're unsure, you could always post the code and we could try and find out what the issue is.
     
  3. Offline

    Epitastic

    I have Java 7 on my computer, though. Is it possible to update my server to Java 7 instead of keeping it at Java 6?
     
  4. Offline

    xTrollxDudex

    I'm no Mac expert but can't you just go to java.com and install java7
     
  5. Offline

    Epitastic

    xTrollxDudex
     
Thread Status:
Not open for further replies.

Share This Page