[edit]Now I can see that quote isn't clear. There is a blank, empty line at the bottom of it.Campbell's terminal (bash) wrote:echo $CLASSPATH
Campbell Ritchie wrote:In .bashrc, it should read
export PATH=/usr/bin:etc
Campbell Ritchie wrote:
Don't simply copy the PATH you have in /etc/environment. You don't need the same PATH twice.
Campbell Ritchie wrote:
You should probably miss out the quote marks in the PATH and XYZ_HOME variables, and they need export too.
Campbell Ritchie wrote:
I have commented out the PATH with a # sign and shortened it for reasons explained here.
You can change your PATH temporarily by writing a similar export instruction at a terminal. If that directory actually existed, I could use Java9 for the lifetime of the current terminal with this instruction:-Because Java9 precedes Java8 in the new PATH, it will take precedence over Java8.
Campbell Ritchie wrote:
Have you got the problem about Hello World sorted out?
Campbell Ritchie wrote:
Dave Tolls is right: tell us which directory you are in (pwd) and whether those files are in the same location (ls)
Dave Tolls wrote:
What files are in the directory you are trying to run that HelloWorldApp? Can you list them here?
Dave Tolls wrote:
What command(s) are you running? Can you copy/paste them here as well, along with the output?
Campbell Ritchie wrote:
If there are both HelloWorldApp.java and HelloWorldApp.class in your current location, show us the entire text of the .java file.
Campbell Ritchie wrote:I have commented out the PATH with a # sign and shortened it for reasons explained here.?
Remove the top three lines, which only appear to be duplicates of lines 4‑6.Brian Jones Jr. wrote:. . . Ok, so my export statements look like this.
The general PATH should be in /etc/environment. Only use .bashrc for something you installed for your own use. Otherwise any other users can't use any programs from the terminal. I think you should restore the PATH in /etc/environment. That doesn't appear to need export.. . . . Should the PATH variable definition be in /etc/environment or in .bashrc?
It is an important resource for the OS (=operating system). Whenever there is an instruction to run a program, the OS goes through the PATH looking for something with the same name.. . . I don't know too much about the PATH variable. . . .
No, nonononononono, no, no no, spelt y‑e‑s. I think you ought to restore the PATH to its original location, but if you are getting your terminal to run, you can get away with continuing like that for a little.Do you think that this might be part of the problem? Can I leave my PATH variable like it is for now, and get back to this later? . . .
Campbell Ritchie wrote:
Remove the top three lines, which only appear to be duplicates of lines 4‑6.
Campbell Ritchie wrote:
I think you should restore the PATH in /etc/environment.
Campbell Ritchie wrote:
How did you install Java®?
Campbell Ritchie wrote:
In a fit of desperation I shall suggest a couple of things, but we really are scraping the bottom of the barrel here:-1: cd / then sudo grep -R "CLASSPATH=" * which should find any files where you have set a CLASSPATH and forgotten. 2: export CLASSPATH=~/Documents:$CLASSPATH:~/Documents then echo $CLASSPATH
That will really mess up your CLASSPATH, but if you set it at the terminal, it won't affect other terminals. See whether you have somehow got the CLASSPATH set to whitespace only.
Our FAQ includes a link to webupd8team which seems to give instructions about the same product, but simpler than what you quoted.Brian Jones Jr. wrote:. . . I was trying to learn how to install Java from command line. I think it would be helpful for use with Docker. I think I used this website:
Java CLI installation . . .
Our pleasureThanks Campbell and Dave. I learned a lot!
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|