Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: Trying to compile Fails

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Trying to compile Fails

    Hi I have been doing Tutorials online for a while and have found an old game that I wanted to load and improve. I was told it doesn't take much to work on so i downloaded it and changed paths to my java and this is the error I get when I try to compile.

    Buildfile: build.xml

    compile:
    [javac] Compiling 167 source files to C:\Users\Katrina\Desktop\EasyRSC\EasyR
    SC\Server\build
    [javac] javac: target release 1.5 conflicts with default source release 1.7


    My Java is 1.7 and I am not sure what it means when it says target release 1.5 conflicts. Understand I am very new to this and I am very sorry if this is in the wrong thread I looked but was not sure what this should be listed under.

    Thank You for any help you can give!


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Trying to compile Fails

    Try changing the target to 1.7 instead of 1.5.

    This can be done by opening the build.xml file and searching for anywhere that has target="1.5" and replacing it with target="1.7"
    Last edited by helloworld922; June 11th, 2012 at 08:55 AM.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Trying to compile Fails

    I have checked the build.xml and there is no target="1.7". Could it be one of the files it's trying to compile, a friend of mine got it to work and everything but didnt for me and he didn't have to change anything exept what java he had. Could it be in the file it is trying to compile? And why would it work for him with same java? I have redownloaded java 3 times and reset path to be sure and all older versions deleted.
    taskkill /F /IM java.exe
    set PATH=%PATH%;ant\ant\bin
    set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
    ant compile

    This is what path is set to and it keeps giving the error.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Trying to compile Fails

    Please post the javac ant command in your build.xml file (or at least the meat of the command)

  5. #5
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Trying to compile Fails

    Ok so there was a 1.5 I don't know how i missed it I am still pretty new. java.exe not found, I googled it and could not find anything on it.


    ERROR: The process "java.exe" not found.
    Buildfile: build.xml

    compile:
    [delete] Deleting: C:\Users\Katrina\Desktop\EasyRSC\EasyRSC\Server\rs cd.jar
    [mkdir] Created dir: C:\Users\Katrina\Desktop\EasyRSC\EasyRSC\Server\bu ild
    [javac] Compiling 167 source files to C:\Users\Katrina\Desktop\EasyRSC\EasyR
    SC\Server\build
    [javac] Note: C:\Users\Katrina\Desktop\EasyRSC\EasyRSC\Server\sr c\org\rscdae
    mon\server\GUI.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.


    This happens when I try to compile server.


    @echo off
    taskkill /F /IM java.exe
    set PATH=%PATH%;ant\bin
    set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04\
    ant
    pause

    Could I tell someone where I get the server at so they could at least see what they are trying to help me with? And could also run it and if it works than gotta be me somehow. If so it is Brutalpkers.net and its the first thread.
    Last edited by d_davis90; June 12th, 2012 at 12:48 AM.

  6. #6
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Trying to compile Fails

    try adding the JRE bin folder to your path. This typically exists in C:\Program Files\Java\jre7\bin

  7. #7
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Trying to compile Fails

    Tryed and it failed with the same errors, I don't understand what could be wrong if others ran it after setting the path correctly and it worked fine... Has to be something with my computer is my guess, what could be wrong if i redownloaded set path and it didn't run. What else could cause this on my computer.

  8. #8
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Trying to compile Fails

    What machine are you using? Linux, Windows, other?

  9. #9
    Junior Member
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Trying to compile Fails

    Windows 7, I dont understand why it won't work. Not sure what else to try.

  10. #10
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Trying to compile Fails

    Pease post the relevant ant code/target that fails, and the corresponding error.

Similar Threads

  1. Tomcat Server Fails to run Application
    By anelsonwilson in forum Web Frameworks
    Replies: 9
    Last Post: March 20th, 2012, 03:31 AM
  2. server/client application fails when client closes
    By billykid in forum Java Networking
    Replies: 4
    Last Post: January 26th, 2012, 01:54 AM
  3. Insert Data to Qracle DB fails (query works)?
    By Andeas_L in forum JavaServer Pages: JSP & JSTL
    Replies: 6
    Last Post: January 17th, 2012, 07:14 AM
  4. Test Fails but I don't know why, please help
    By cutekill0 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: September 22nd, 2011, 12:31 PM
  5. java applet program question (on getting path fails)
    By hellocheese in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 30th, 2011, 04:34 PM