• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difficulty with Ubuntu, the JDK, and terminal  RSS feed

 
Austin Hilten
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently put in Ubuntu and had to wipe off windows 7. Starting from fresh i downloaded the JDK for linux so that i could write programs for class. I am "assuming" I correctly downloaded it (but if there is a way to determine this than let me know). I pasted a program i knew that compiled and ran correctly into gedit, and saved it. When I went to terminal to check if it tested fine, an error came up as: **javac: file not found: Geometry_010473030.java Usage: javac <options> <source files>use -help for a list of possible option**
As a very beginner student of Java, I am clueless to where/how to save my programs so that they can properly compile. I got away with this before because I would use a online compiler to check my code, and because at school whenever i opened and saved a program with notepad++, it would automatically know where to save it (computer sci lab) so i never learned how to do the same for my computer. I need help because now I have to write programs that work off each other. Thanks for the help.
 
Junilu Lacar
Sheriff
Posts: 11481
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this FAQ page: http://www.coderanch.com/how-to/java/how-to-create-java-program
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it gives that sort of error message, then you have probably installed Java correctly. Try the following:-
java -version
javac -version
And tell us what the output is. That is probably the easiest way to determine that you have installed it correctly. If you look on the FAQ page quoted, try the webupd8team link given for future updates. Note that appears to work for Ubuntu only.

The error you are getting is a file not found error. Start by showing us what happens when you write
echo $CLASSPATH
at a terminal. Note that unlike Windows, *nix terminals are case‑sensitive. Also open a terminal, navigate to wherever you think you have put your .java files and show us what happens when you use the ls command. Or ls *.java
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!