Tagged Questions
1
vote
1answer
58 views
How do I find all the constructors in a java code base?
I'd like to find all the constructors for a given directory structure with many java files.
I was thinking about a bash shell that greps for the file name in the file to find the constructor.
My goal ...
0
votes
3answers
63 views
Passing args[] to java app with spaces
If you pass an arg to a java app via a bash script, and the arg contains whitespaces, how can you make the java app see the entire string as the arg and not just the first word? For example passing ...
0
votes
1answer
50 views
How to pass parameter to shell script in java program
i am trying to run this java code that calls the shell script on runtime.
when i run the script in terminal i am passing argument to script
code:
./test.sh argument1
java code:
public class ...
0
votes
2answers
74 views
Parentheses in java .properties files?
I am trying to pass a sql query into a java class via a bash shell script, the script gets the query from an external EnvFile.properties. The query in the properties file looks like:
DDAQUERY1=SELECT ...
0
votes
0answers
32 views
Shell started with ProcessBuilder, tar doesn't work
I'm trying to start a shell script, which restores a backup.tar.gz from a Java program.
It's a little bit strange, but it appears to me, as if the tar -xzvf $d.tar.gz is not executed, if I run the ...
0
votes
2answers
58 views
Running a bash command from within a Java program
Consider a piece of Java code:
import java.io.IOException;
public class Demo{
public static void main(String []args) throws IOException{
...
String ...
0
votes
2answers
69 views
How does one make javac use a .jar's classes?
I am studying (cramming) for the AP Computer Science test. One of the requirements is the need to familiarize oneself with a program called "GridWorld." In my studies, I have been running and ...
0
votes
3answers
88 views
Pass a string with spaces to an execute command in Java to execute a bash script
How do I pass a string with spaces to an execute command in Java to execute a bash script?
I'm trying to use a script to generate and send a email using the unix mail command but it ignores the ...
2
votes
1answer
55 views
Shell (bash) brace expansion with Java's runtime.exec
I'm trying to get an expansion command to work with runtime.exec, but the braces are being interpreted as literals rather than being expanded. Here's what I'm trying to do:
String command = "mkdir -p ...
2
votes
2answers
41 views
Copying and pasting files within .jar
I am writing a script that will copy a bunch of files from a .jar file and I want to paste it into another .jar file.
This is a bash script.
How can I do this without having to extract and repack ...
1
vote
2answers
49 views
Java file limit on OSX lower than in bash
I've increased the max files limit on my macbook pro so that Elasticsearch can work with more files, but it isn't working.
I run the command 'ulimit -a' and it says "open files" is 100,000. I can ...
2
votes
3answers
96 views
Execute python script from java
I am trying to make this works since 2 days ago but I don't know why it doesn't.
I can execute normal linux commands (ls, pwd...) without problems but I try to execute a python script and nothing ...
0
votes
0answers
69 views
error=13, Permission denied while executing script in Java
I have a Java code which on execution will present a GUI button to user, and upon pressing it; a bash script would be executed. My script works on terminal, but when I try to run the script in Java ...
2
votes
1answer
62 views
Auto-detect tomcat failed start by bash scripts
I wrote a bash script to auto-deploy a web-application to tomcat container whenever it is triggered. It is pretty straight-forward:
Dump the current database for back-up
Shutdown the current tomcat ...
0
votes
1answer
45 views
Getting /dev/null: ambiguous redirect error in unix
I am using a shell script to find out files which contains a class file from a list of JAR files in UNIX using bash script:
find . -name "*.jar" -exec bash -c 'jar -tf {} |grep -H --label {} ...