This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Solving a complex programming problem

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Did you close the environment variables window when you were done? Did you restart the command prompt afterward?

Please show us the content of the SW folder.



yes i did all these despite that i am getting that mentioned error:-

attached is the screen shot showing SW contents.
SW-folder-contents.png
[Thumbnail for SW-folder-contents.png]
 
Saloon Keeper
Posts: 11189
244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so your Java folder is not actually F:\Java Training\SW, but rather F:\Java Training\SW\java-se-8u41-ri. Update the JAVA_HOME variable accordingly.
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Okay, so your Java folder is not actually F:\Java Training\SW, but rather F:\Java Training\SW\java-se-8u41-ri. Update the JAVA_HOME variable accordingly.



Even after updating JAVA_HOME variable value to F:\Java Training\SW\java-se-8u41-ri as shown in attached screen shot and the PATH variable's value to '%JAVA_HOME%\bin;

nothing is changing i am still getting the same error for running java -version command from command prompt.

please refer screen shots for these variables values.
JAVA_HOME-value.png
[Thumbnail for JAVA_HOME-value.png]
PATH-variable-value.png
[Thumbnail for PATH-variable-value.png]
 
Stephan van Hulst
Saloon Keeper
Posts: 11189
244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sign out of your Windows user session and try again. If it doesn't work, show us the contents of the F:\Java Training\SW\java-se-8u41-ri\bin folder, and also show us the result of running the following command:
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Sign out of your Windows user session and try again. If it doesn't work, show us the contents of the F:\Java Training\SW\java-se-8u41-ri\bin folder, and also show us the result of running the following command:



What do you mean here by sign out of windows user session -do you mean should i restart my system?

also please find the required screen shots attached here.
-ECHO-Screenshot.png
https://coderanch.com/t/726461/a/10753/-ECHO-Screenshot.png
SW-folder-contents.png
[Thumbnail for SW-folder-contents.png]
-ECHO-Screenshot.png
[Thumbnail for -ECHO-Screenshot.png]
 
Stephan van Hulst
Saloon Keeper
Posts: 11189
244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liked I asked, show the contents of the F:\Java Training\SW\java-se-8u41-ri\bin folder, not the F:\Java Training\SW\java-se-8u41-ri\lib folder.
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Liked I asked, show the contents of the F:\Java Training\SW\java-se-8u41-ri\bin folder, not the F:\Java Training\SW\java-se-8u41-ri\lib folder.



after java-se-8u41-ri i have this lib folder only which has 3 subfolders javax,META-INF,SUN and a zip file called 'dt' all this is visible in the screenshot attached with my previous post.
i could not find any such bin folder here.
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any updates by expertsplease as i don't find that bin folder here as stated in my previous post.
 
Marshal
Posts: 67464
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have inspected the Java8/Win/i586 download from the link I gave you here, and it definitely contains a bin folder.

Kindly download that file, unzip it into F:\Java Training\SW, which appears to be where you want it, and read the instructions we gave you about setting the JAVA_HOME and PATH variables.
 
Stephan van Hulst
Saloon Keeper
Posts: 11189
244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The environment variables are set correctly. Either your download was corrupted or you didn't unpack the entire ZIP.

Download and unpack the ZIP again. It must contain a bin folder.
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:I have inspected the Java8/Win/i586 download from the link I gave you here, and it definitely contains a bin folder.

Kindly download that file, unzip it into F:\Java Training\SW, which appears to be where you want it, and read the instructions we gave you about setting the JAVA_HOME and PATH variables.



thanks ,it might have missed while downloading but it seems now as per instructions  it's installed correctly please refer attached screen shots.

Now how to install maven without which i can't be java expert?
command-prompt-screen-shot.png
[Thumbnail for command-prompt-screen-shot.png]
JAVA_HOME.png
[Thumbnail for JAVA_HOME.png]
PATH.png
[Thumbnail for PATH.png]
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Ken wrote:

Campbell Ritchie wrote:I have inspected the Java8/Win/i586 download from the link I gave you here, and it definitely contains a bin folder.

Kindly download that file, unzip it into F:\Java Training\SW, which appears to be where you want it, and read the instructions we gave you about setting the JAVA_HOME and PATH variables.



thanks ,it might have missed while downloading but it seems now as per instructions  it's installed correctly please refer attached screen shots.

Now how to install maven without which i can't be java expert?



ok,i just checked previous post there was one link to download maven < http://maven.apache.org/download.cgi >

but it contains too many links as shown in attached screen shot so currently not sure which one to download for required maven.

maven-links.png
[Thumbnail for maven-links.png]
 
Stephan van Hulst
Saloon Keeper
Posts: 11189
244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Binaries are software you can run. Sources are the source code that Java was written in. Do you want to use Java or do you want to look at its source code?

Checksums are used to verify that the software that you downloaded matches the software that is offered on the website.

Signatures are used to verify that the software that you downloaded is really written by the people who say they have written it.

.zip files are more common to Windows and .tar.gz files are more common to Unix.

With all that knowledge, you should be able to figure out which link to click.
 
John Ken
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You will also want to use Maven at some point. Get it here. Assuming you unpacked Maven to C:\Program Files\Apache\Maven 3.6.3,

  • set M2_HOME to C:\Program Files\Apache\Maven 3.6.3
  • set M2 to %M2_HOME%\bin
  • prepend PATH with %M2%;

  • Restart CMD and run 'mvn -v'.


    after installing Maven to my F drive in this location where I have bin folder-F:\Java Training\SW\Maven\apache-maven-3.6.3

    I have created a new variable M2_HOME and assigned it the value 'F:\Java Training\SW\Maven\apache-maven-3.6.3'

    but for the PATH variable I already have value assigned to it for JAVA_HOME vriable  :-
    F:\Java Training\SW\java-se-8u41-ri

    and associated PATH variable for this JAVA has below value already assigned to it :-

    %JAVA_HOME%\bin;


    Now how to assign same variable PATH to new value for Maven which you have advised to put in it.
     
    Stephan van Hulst
    Saloon Keeper
    Posts: 11189
    244
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Like I said, you need to prepend it to the existing PATH value, and I explained what prepending means:

    Stephan van Hulst wrote:When I say you need to prepend something to the PATH environment variable, it means you need to add it in front of what's already configured there. Make sure to separate paths with a semi-colon.

     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Stephan van Hulst wrote:Like I said, you need to prepend it to the existing PATH value, and I explained what prepending means:

    Stephan van Hulst wrote:When I say you need to prepend something to the PATH environment variable, it means you need to add it in front of what's already configured there. Make sure to separate paths with a semi-colon.



    i did same as advised please refer attached screen shot for this maven path separated with semicolon for java but after this when ran command 'mvan -v'
    got error 'mvn is not recognized...'
    PATH.png
    [Thumbnail for PATH.png]
     
    Stephan van Hulst
    Saloon Keeper
    Posts: 11189
    244
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    So, after all that we've been through in the last two pages in this topic, do you have an idea how you can debug this problem?
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Stephan van Hulst wrote:So, after all that we've been through in the last two pages in this topic, do you have an idea how you can debug this problem?



    sorry i don't have any idea maybe separate path variable for maven ?
     
    Stephan van Hulst
    Saloon Keeper
    Posts: 11189
    244
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    First print the PATH variable to the command line using the echo command, like we've done before. See if it contains the path to Maven's bin folder, the folder containing mvn. If it does contain a path to Maven, but it's not exactly the right folder, you need to change your variables. If it doesn't contain a path to Maven at all, you haven't set the M2_HOME and M2 variables.
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Stephan van Hulst wrote:First print the PATH variable to the command line using the echo command, like we've done before. See if it contains the path to Maven's bin folder, the folder containing mvn. If it does contain a path to Maven, but it's not exactly the right folder, you need to change your variables. If it doesn't contain a path to Maven at all, you haven't set the M2_HOME and M2 variables.



    PATH screen shot and M2_HOME screen shots attached and  maven location in my system:- F:\Java Training\SW\Maven\apache-maven-3.6.3

    M2_HOME Variable declared in system with variable  value :-F:\Java Training\SW\Maven\apache-maven-3.6.3

    PATH.png
    [Thumbnail for PATH.png]
    M2_HOME-Value.png
    [Thumbnail for M2_HOME-Value.png]
    ECHO-screen-shot-for-PATH.png
    [Thumbnail for ECHO-screen-shot-for-PATH.png]
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    John Ken wrote:

    Stephan van Hulst wrote:First print the PATH variable to the command line using the echo command, like we've done before. See if it contains the path to Maven's bin folder, the folder containing mvn. If it does contain a path to Maven, but it's not exactly the right folder, you need to change your variables. If it doesn't contain a path to Maven at all, you haven't set the M2_HOME and M2 variables.



    PATH screen shot and M2_HOME screen shots attached and  maven location in my system:- F:\Java Training\SW\Maven\apache-maven-3.6.3

    M2_HOME Variable declared in system with variable  value :-F:\Java Training\SW\Maven\apache-maven-3.6.3



    maven and java_home screen shots showing their paths:-
    maven-java-path.png
    [Thumbnail for maven-java-path.png]
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    John Ken wrote:

    John Ken wrote:

    Stephan van Hulst wrote:First print the PATH variable to the command line using the echo command, like we've done before. See if it contains the path to Maven's bin folder, the folder containing mvn. If it does contain a path to Maven, but it's not exactly the right folder, you need to change your variables. If it doesn't contain a path to Maven at all, you haven't set the M2_HOME and M2 variables.



    PATH screen shot and M2_HOME screen shots attached and  maven location in my system:- F:\Java Training\SW\Maven\apache-maven-3.6.3

    M2_HOME Variable declared in system with variable  value :-F:\Java Training\SW\Maven\apache-maven-3.6.3



    maven and java_home screen shots showing their paths:-



    maven error
    maven-error.png
    [Thumbnail for maven-error.png]
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    looks like  after giving attache screen shots settings maven is installed but seems some errors could someone please help ?
    Maven-errors.png
    [Thumbnail for Maven-errors.png]
    M2-Value.png
    [Thumbnail for M2-Value.png]
    M2_HOME-Value.png
    [Thumbnail for M2_HOME-Value.png]
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    John Ken wrote:looks like  after giving attache screen shots settings maven is installed but seems some errors could someone please help ?



    PATH-Value.png
    [Thumbnail for PATH-Value.png]
    ECHO-PATH-VALUE.png
    [Thumbnail for ECHO-PATH-VALUE.png]
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    John Ken wrote:

    John Ken wrote:looks like  after giving attache screen shots settings maven is installed but seems some errors could someone please help ?





    Now my system is not recognizing java and upon executing java -version i am getting error like earlier
    so i removed maven m2_home and m2 variables and updated path variable just for java still same error now even it is not recognizing java itself.
    i am confused a lot now so could  someone please help to install both java and maven properly now?

    please refer attached screen shot.
    java-error.png
    [Thumbnail for java-error.png]
     
    Campbell Ritchie
    Marshal
    Posts: 67464
    257
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Windows┬« might be case‑insensitive, and might not distinguish JAVA from java or jAvA. But Java┬« is case‑sensitive. The option is -version not -VERSION.

    Please don't keep guessing about the changes you are making to your environment variables. You should have seen by now that all you are achieving is tying yourself in knots.
     
    John Ken
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    thanks much ..

    now it seems i have correctly configured java & maven both.

    please refer attached screen shot for the same.
    java-maven.png
    [Thumbnail for java-maven.png]
     
    The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
    Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
    https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!