Java problem

murphey

Touchdown! Greaser!
Joined
Aug 21, 2008
Messages
11,662
Location
Colorado
Display Name

Display name:
murphey
I'm teaching basic Java. All the students have it installed but only half of them can use it.
At the command line, I can verify both the compiler (javac) and the executable (java) are installed, I can see the directory, and confirm installation.
I confirm the directories are in the PATH (Mac & Linux) and in the Windows PATH in the Environment variables.
However, it's not possible to run the compiler. I get an error message that the javac doesn't exist.

What's infuriating is that it's happening on all 3 OS's. And the version of Java doesn't matter.

Anyone got any ideas?
 
Linux/Mac
1. Using the command line, from the account that you're trying to run javac, verify the location with "which javac"
2. Do "file javac" on the javac that the which exposes. Is it a program or a script? Is the script pointing to the right place?

What's the error message that running javac provides?

I've found that sometimes java is installed under /etc/alternatives and you have to follow the links to the actual java programs. It's controlled by the wonderful "alternatives" command. Sometimes the links get screwed up.

Windows
No ideas. Windows is bad.
 
Linux/Mac
1. Using the command line, from the account that you're trying to run javac, verify the location with "which javac"
2. Do "file javac" on the javac that the which exposes. Is it a program or a script? Is the script pointing to the right place?

What's the error message that running javac provides?

I've found that sometimes java is installed under /etc/alternatives and you have to follow the links to the actual java programs. It's controlled by the wonderful "alternatives" command. Sometimes the links get screwed up.

Windows
No ideas. Windows is bad.

Also, I use StackOverflow a lot. https://stackoverflow.com/search?q=javac+not+found&s=94bbba6b-f237-417d-9d78-dee239d03397
 
Forgot the JDK....I have it on my system, need to make sure the students have it.

thanks for the reminder to head over the stackoverflow.
 
Consider -

The PATH (lets just say this is Windows 'cos that's what I have here) is inherited by the command window when it starts. So changes to the path are not propagated to old command windows. Use a new command window, and maybe get rid of the old ones. Suspect Linux, Mac similar.

Or of course a reboot will mysteriously fix it.
 
Sounds like some only have the runtime installed and you already figured that out.
 
Back
Top