• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Head First Java - set up

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I am starting down the Java path and am Extremely new...EXTREMELY. I am using a book called Head First Java (Second Version) and am literally stuck on the Setting Up Java Section.

The requirement is that I "add an entry to your PATH environment variable that points to the /bin directory inside the main Java directory. For example if the J2SDK puts a directory on your drive called "j2sdk1.5.0" look inside that directory and you'll find "bin" directory where the Java binaries (the tools) live. The bin directory is the one you need a PATH to, so that when you type: % javac at the command-line, your terminal will know how to find the javac compiler."

I am working on a mac and this means nothing to me. Can anyone guide me on what it is I should be doing? happy to give more details if needed!

Thanks in advance.
 
Bartender
Posts: 2236
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

You will find the answer here: https://coderanch.com/wiki/659740/create-Java-program
 
Jake Rotkvich
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Pawel, appreciate it! That was exactly what I was looking for, thanks a ton!
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paweł Baczyński wrote:Welcome to the Ranch!

You will find the answer here: https://coderanch.com/wiki/659740/create-Java-program

I am a super beginner and I can set up Java on my mac. I just don't get it. I followed your previous link and I could do it. any other hints?
 
Paweł Baczyński
Bartender
Posts: 2236
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would help if you shared what you don't get.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just don’t get it from top to bottom. It seems my Mac computer has java. But when the book says I need to download from java oracle etc website the J2SE API documentation. I don’t see the connection and i don’t find them either on java website. What am i doing wrong? Plus how does Java look like when working? I just cannot find something on the internet
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

To quote Daniel Demesmaecker: Open up Terminal.app (Applications >> Utilities >> Terminal).
Then follow the instructions in this recent post to see which version of Java® you already have installed. Tell us what the results are, and we'll see whether you need to take any more action.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

To quote Daniel Demesmaecker: Open up Terminal.app (Applications >> Utilities >> Terminal).
Then follow the instructions in this recent post to see which version of Java® you already have installed. Tell us what the results are, and we'll see whether you need to take any more action.

I open as directed and when opened the other window and typed as directed it says it doesn't exist.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

Campbell Ritchie wrote:Welcome to the Ranch

To quote Daniel Demesmaecker: Open up Terminal.app (Applications >> Utilities >> Terminal).
Then follow the instructions in this recent post to see which version of Java® you already have installed. Tell us what the results are, and we'll see whether you need to take any more action.

I open as directed and when opened the other window and typed as directed it says it doesn't exist.

indeed, i couldn't save the emacs thing either because it doesn't follow the command save etc
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But we only need to see what version numbers you are getting. What happened when you wrote...at the terminal?
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paweł Baczyński wrote:It would help if you shared what you don't get.

it seems after much research that i needed to put some commands and then the screen would pop up. but when i tried to make sure the bin was right path etc it says it doesn't exist.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:But we only need to see what version numbers you are getting. What happened when you wrote...at the terminal?

version 11.0.2
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Was that the same for both?
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

Campbell Ritchie wrote:Welcome to the Ranch

To quote Daniel Demesmaecker: Open up Terminal.app (Applications >> Utilities >> Terminal).
Then follow the instructions in this recent post to see which version of Java® you already have installed. Tell us what the results are, and we'll see whether you need to take any more action.

I open as directed and when opened the other window and typed as directed it says it doesn't exist.

 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Was that the same for both?

the second is shorter just gives the 11.0.2
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

Campbell Ritchie wrote:Was that the same for both?

the second is shorter just gives the 11.0.2


both show same numbers however the first choice java -version is longer  
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would appear that you already have just about the most recent version of Java® already, so there is no need for further action: you can start programming
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

cesar betancourt wrote:

Campbell Ritchie wrote:Was that the same for both?

the second is shorter just gives the 11.0.2


both show same numbers however the first choice java -version is longer  


yes the numbers are  the same for both
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

cesar betancourt wrote:

cesar betancourt wrote:

Campbell Ritchie wrote:Was that the same for both?

the second is shorter just gives the 11.0.2


both show same numbers however the first choice java -version is longer  


yes the numbers are  the same for both


I followed the blogs steps but when I typed in another window  the command to make sure it was there it shows nothing. maybe it does not save or something went wrong
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:It would appear that you already have just about the most recent version of Java® already, so there is no need for further action: you can start programming


well I will give it a chance.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

Campbell Ritchie wrote:It would appear that you already have just about the most recent version of Java® already, so there is no need for further action: you can start programming


well I will give it a chance.


thanks a lot
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cesar betancourt wrote:

cesar betancourt wrote:

Campbell Ritchie wrote:It would appear that you already have just about the most recent version of Java® already, so there is no need for further action: you can start programming


well I will give it a chance.


thanks a lot


I just do not know what i am doing wrong with my java on mac. I am learning from head first java book by kathy and bert and just can't get to understand how to match text edit path and java together. i just don't get. i have them all but when i am trying to program don't know where to begin with or font grasp why three for one thing. any thoughts?
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will try to step you through the diagnosis. You have to do exactly as I ask though. When I ask you to copy-paste from the terminal, do exactly that and surround the text with "tt" tags (That is, when you're typing in your reply/message, you'll see a row of buttons you can use to format your post. These buttons are labeled "b", "i", "u", "strike", "tt", etc. Highlight the text you paste in from your terminal, then click on the button that is labeled "tt" to format it with fixed width font)

You can use the Preview button that's to the left of the Submit button to see what your post will look like.

This is what I see on my Mac when I run some of the commands others have asked you to run. The commands I typed in are shown in bold font.

jlacar$ which java
/usr/bin/java

jlacar$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

jlacar$ javac -version
javac 11.0.1


Run the same commands as shown above and then copy-paste your terminal output into your reply so we know exactly what you're seeing. Remember to use the "tt" button to format what you copy-pasted from your terminal.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:This is what I see on my Mac when I run some of the commands others have asked you to run. ...


I can see the same thing that you have written. what do you mean with copy paste my terminal output into my reply? thanks

Moderator edit: shortened long quote
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you go and find some tutorials on how to copy-paste text on a Mac.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:I suggest you go and find some tutorials on how to copy-paste text on a Mac.

cesars-MacBook-Pro:~ cesarbetancourt$ which java
/usr/bin/java
cesars-MacBook-Pro:~ cesarbetancourt$ java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
cesars-MacBook-Pro:~ cesarbetancourt$ javac -version
javac 11.0.2
cesars-MacBook-Pro:~ cesarbetancourt$

 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, now that you know how to copy-paste from your Terminal window, show us what you did that you think didn't work. Again, copy-paste from your terminal so we can see exactly what you're seeing.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:Ok, now that you know how to copy-paste from your Terminal window, show us what you did that you think didn't work. Again, copy-paste from your terminal so we can see exactly what you're seeing.


thanks again. i don't see the link between path, bin, text edit or where is source to write the codes. where source is at in all this, the compiler. how do i get access to them.
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think we're understanding each other. I'm not sure what you mean by "I don't see the link" -- do you mean to say you don't know how they relate to each other and how they all work together to allow you to edit, compile, and run Java programs?
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are certain basic things you should know before you attempt to write programs in any language.

1. How to navigate around the file system on a Mac in Finder
2. How to navigate around the file system on a Mac in Terminal
3. How to edit and save text files on a Mac

Learn how to do these basic operations first.

Also, you can easily find all of the above through search engines like Google. As you can see from those links, it's really as easy as typing in whatever question you have in plain English.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:I don't think we're understanding each other. I'm not sure what you mean by "I don't see the link" -- do you mean to say you don't know how they relate to each other and how they all work together to allow you to edit, compile, and run Java programs?


i don't know how they relate to each other. to edit, compile and run java programs such as what is source or what is compiler and how to identify them or get access to them. I have been watching tutorials on the internet and none of them quite get the simple idea of it. i want something practical. thanks
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, Google is your friend.

What is source code
What is a compiler
What does it mean to compile a program?

It really isn't that hard.
 
cesar betancourt
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:There are certain basic things you should know before you attempt to write programs in any language.

1. How to navigate around the file system on a Mac in Finder
2. How to navigate around the file system on a Mac in Terminal
3. How to edit and save text files on a Mac

Learn how to do these basic operations first.

Also, you can easily find all of the above through search engines like Google. As you can see from those links, it's really as easy as typing in whatever question you have in plain English.


I do not think you understand me. I just want to know the concept and imagery of source and compiler in java and how to have access to the them in a very simple manner.
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I don't understand what it is you're looking for. Maybe it's time to let someone else try to help you. Good luck.
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cesar betancourt: Could you please start your own thread as the OP has resolved this one.
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow those path issues are old these days. Just download the JDK from Oracle then download Eclipse for Mac . When you got Eclipse installed go to Window/Preferences/Java /Compiler and make sure it shows in the path which it should automatically now. And you can follow your head first Java book and skip the pages related to the Java path go directly to the programming part.
 
reply
    Bookmark Topic Watch Topic
  • New Topic