Forums Register Login

how do i run java in svn linux terminal

+Pie Number of slices to send: Send
I have a lot of Java file in the repository(svn add and commit), I know that javac is way to compile the java file but the problem is how do i run this Java file in the svn directory?
1
+Pie Number of slices to send: Send
You would not have an svn directory as such. You would have the name of a project and you would download the .java files into a suitably named directory from the svn repository. How you compile them depends on whether you have multiple packages or not.
If you have everything in the unnamed package, as many people on this forum do, it is enough to pass
javac *.java
at a terminal.
If you have .java files in directories, you shou‍ld ensure the package declarations match the directory structure. Presumably you have previously compiled those files (or somebody else has), so the directory structure has probably been sorted out already. And any compiler errors corrected. Have a look for README or xyz.sh files; they may have compilation instructions in. Or you can remember how they files were compiled earlier.
Any classes which are dependencies for anything else shou‍ld be compiled first. If you need to compile class Foo in package foo, you will want
javac foo/Foo.java
at the terminal. If you haven't found an xyz.sh file, create your own. Copy'n'paste all compiler instructions which work into your own .sh file and add that to the repository for future reference; next time simply run the .sh file. If the instruction doesn't work, try a different class. Start as far from the class with the main method as possible and compile that class last.

Alternatively: open the entire contents as a project in an IDE and let the IDE do all the hard work.

Moving as too complicated a question for “Beginning”
1
+Pie Number of slices to send: Send
I'm not sure if I understand your question completely, but like Campbell said, javac *.java is how you compile and to run the program it's just 'java programName' at the terminal.
+Pie Number of slices to send: Send
that make a lot of sense now. Just to make sure .sh file is a script shell that I need implemented the  make linux command or makefile in the .sh file
1
+Pie Number of slices to send: Send
 

jin Otanashi wrote:that make a lot of sense now. Just to make sure .sh file is a script shell that I need implemented the  make linux command or makefile in the .sh file



A .sh file can be a bash script file, but it is absolutely not related to Java as Java and Bash are two different languages. Shell scripting is different in Linux and to compile a shell script you need to make sure that you have executable access of that file in your permissions (chmod command allows you to modify permissions). Then you can execute that script with ./filename.sh
+Pie Number of slices to send: Send
 

Naziru Gelajo wrote:

jin Otanashi wrote:that make a lot of sense now. Just to make sure .sh file is a script shell that I need implemented the  make linux command or makefile in the .sh file



A .sh file can be a bash script file, but it is absolutely not related to Java as Java and Bash are two different languages. Shell scripting is different in Linux and to compile a shell script you need to make sure that you have executable access of that file in your permissions (chmod command allows you to modify permissions). Then you can execute that script with ./filename.sh


I see thank you for letting me know
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 619 times.
Similar Threads
SVN: add of not immediate child
The compilation unit is not on the build path..
Collecting filenames from command line?
SVN commit problems
SVN repo url
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:38:26.