Monday, April 29, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 4890  / 1 Year ago, wed, january 4, 2023, 9:48:17

I wrote a java program first time on Linux.



This is where my program Test.java is located:



Desktop> APCS (folder)> Chapter5 (folder) > Test.java



I know that to compile I have to type javac Test.java and to run "java Test".



Before that, I have to type cd Desktop, cd APCS, cd Chapter5.



Is there any short way to navigate to Test.java?


More From » shortcut-keys

 Answers
4

Two ways to shorten the time it takes to go down multiple directories:




  • You can go down multiple levels at a time, so you can type cd Desktop/APCS/Chapter5

  • Pressing TAB while typing a directory or file name will automatically complete the rest of the filename for you. So if you are in your home folder and need to cd to your desktop, you can type the first two or three letters of Desktop and press tab to automatically complete it



If you need to compile and run your program a lot, make a shell script on your desktop or somewhere else with:



javac ~/Desktop/APCS/Chapter5/Test.java
java ~/Desktop/APCS/Chapter5/Test

[#27861] Thursday, January 5, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
freezidepu

Total Points: 394
Total Questions: 105
Total Answers: 118

Location: Libya
Member since Mon, Dec 7, 2020
3 Years ago
;