• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Difficulty with Ubuntu, the JDK, and terminal

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 16456
272
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
Check out this FAQ page: https://coderanch.com/how-to/java/how-to-create-java-program
 
Marshal
Posts: 73334
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic