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 4 of 4

Thread: set up java (jdk/jre, path) in windows 7

  1. #1
    Junior Member
    Join Date
    Oct 2017
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default set up java (jdk/jre, path) in windows 7

    Hi,

    I got a new laptop with win 7 64 bits. I Installed eclipse helios, but I have some doubts with the setting up

    When I open eclipse I got this error:
    Capture2.jpg

    In eclipse, Properties ->Java build path I have jre7


    C:\Program Files (x86)\Java\jre7\bin

    Which I guess is JRE version 7. But in my command line I have:

    K:\>java -version
    java version "9.0.1"
    Java(TM) SE Runtime Environment (build 9.0.1+11)
    Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

    the file eclipse.ini contains:

    -startup
    plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1 .R36x_v20100810
    -product
    org.eclipse.epp.package.java.product
    --launcher.defaultAction
    openFile
    --launcher.XXMaxPermSize
    256M
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256m
    --launcher.defaultAction
    openFile
    -vmargs
    -vm
    C:\Program Files (x86)\Java\jre7\bin\javaw.exe
    -Dosgi.requiredJavaVersion=1.7
    -Xms40m
    -Xmx512m

    Do I need to add a PATH, as environment variable?

    If I run my app I got this:

    Capture5.jpg

    What am I missing?
    Thank you in advance

  2. #2
    Member
    Join Date
    Apr 2014
    Posts
    81
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: set up java (jdk/jre, path) in windows 7

    Hi,

    In general, if "java -version" returns something good (like in your case), then there's no need to tinker with the PATH environment variable.

    What I believe may be happening is that Eclipse is setup for an older version of Java as the compiler compliance level:

    https://stackoverflow.com/questions/...-in-class-file

    Note this is not the same thing as the build path. So, you have both Java 7 and Java 9 installed. The response to "java -version" says Java 9 is the default (according to PATH). You have Eclipse setup to use Java 7 for the build, but it seems like the Eclipse project's compliance level is set to an older Java version.

    Hope that helps!

  3. #3
    Junior Member
    Join Date
    Oct 2017
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: set up java (jdk/jre, path) in windows 7

    Quote Originally Posted by BinaryDigit09 View Post
    Hi,

    In general, if "java -version" returns something good (like in your case), then there's no need to tinker with the PATH environment variable.

    What I believe may be happening is that Eclipse is setup for an older version of Java as the compiler compliance level:

    https://stackoverflow.com/questions/...-in-class-file

    Note this is not the same thing as the build path. So, you have both Java 7 and Java 9 installed. The response to "java -version" says Java 9 is the default (according to PATH). You have Eclipse setup to use Java 7 for the build, but it seems like the Eclipse project's compliance level is set to an older Java version.

    Hope that helps!
    Thank you for your reply!

    Should I change my java version to 7?

  4. #4
    Member
    Join Date
    Apr 2014
    Posts
    81
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: set up java (jdk/jre, path) in windows 7

    I think you need to change the project's compiler compliance level in Eclipse. See the screenshot in that StackOverflow link.

Similar Threads

  1. [SOLVED] JDK SE, JRE and Eclipse not working
    By NorrinGalan in forum Java IDEs
    Replies: 3
    Last Post: February 7th, 2014, 05:21 AM
  2. No JRE or JDK in JVM
    By Jobrien15 in forum Computer Support
    Replies: 7
    Last Post: October 1st, 2013, 07:40 PM
  3. JRE and JDK Questions
    By beer-in-box in forum Computer Support
    Replies: 11
    Last Post: September 16th, 2011, 05:37 PM
  4. Replies: 2
    Last Post: January 8th, 2010, 08:22 AM
  5. [SOLVED] How to a set java class path?
    By captjade in forum Java Theory & Questions
    Replies: 1
    Last Post: March 10th, 2009, 06:40 AM

Tags for this Thread