Tag Info

New answers tagged

2

The default PATH is set in /etc/profile. Users can modify their PATH by editing ~/.profile, ~/.bash_profile or ~/.bashrc (if they're running bash) but if they don't they will still have a PATH as defined in /etc/profile. That's why the line was PATH=$PATH:$HOME/bin and not just PATH=$HOME/bin That way, the original value of PATH is kept and the new ...


0

For some odd reason /usr/bin/java was no longer pointing to the java installation. No idea how this happened. I confirmed this by running: $ sudo update-alternatives --config java Which gave me the following There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java Nothing to configure. ...


0

JosephR explained the logic better than I can. I suggest removing the cd /home/poppetapp && and just use the following to get your desired result. */5 * * * * pgrep -f test_java_10.jar || /home/poppetapp/test_java.sh > /home/poppetapp/test_java.out


0

I think this may be a grouping issue. I replaced your call to pgrep with a simple true or false: If the process isn't running, pgrep will fail: $ false || echo cd && echo run cd run If the process is running, pgrep will be successful: $ true || echo cd && echo run run In this case, you would want nothing at all to be executed! Running ...


0

The advantage of something like || is it allows you to run something based on a return code. E.g. if the left hand side is false then it evaluates the right hand side, but otherwise it doesn't bother. Here's the problem though - look at the man page for pgrep: The pgrep and pkill utilities return one of the following values upon exit: 0 One or more ...


0

"Invalid argument" when running a Solaris binary often means you installed a version for the wrong architectures - a SPARC binary on an x86 platform or an x86 binary on a SPARC platform. Run uname -p to see what processor type your system has and make sure you downloaded Java for that type of CPU.


0

There's a typo in the jsvc command. I wrote: -classpath [...]:$CATALINA_HOME/bin/tomcat-juli.jar:[...] and not: -classpath [...]:$CATALINA__HOME/bin/tomcat-juli.jar:[...] I removed the unnecessary underscore and now it works.


-1

crontab -e, then add following item * * * * * a=`ps aux | grep abc.jar | grep -v grep | wc -l`; test $a -eq 0 && java -j /path/to/abc.jar


2

You can do this with perl, using the excellent XML::Twig module. Assuming I've understood you correctly, the basics task is copying the 'verse content' element from one file, and 'everything else' from another file, and making a new file. So: #!/usr/bin/perl use strict; use warnings; use XML::Twig; my %nkjv_content; sub extract_content { my ( ...


-1

cd /opt/www/java/jdk/bin/ # jmap -heap <JAVA_PID>


0

If bug is due to using setcap on Java executable, then refer to How to get Oracle java 7 to work with setcap cap_net_bind_service+ep and http://bugs.java.com/view_bug.do?bug_id=7157699 which answers this question in details. ps. In our project we had to do sudo setcap cap_net_bind_service=+ep /path/to/java to allow java binary to open tcp/udp ports ...


0

You can use ldd on java to see if there are libraries missing. You can use strace to see if a file is missing or if it is dlopen()'ing some file.


0

This is indeed a typical error relating to the wrong architecture. However, it's also indicative that the necessary libraries required to run the executable are not found. You need to add your x86-64 libraries for the Java run-time to the LD_LIBRARY_PATH, or add the directory containing them to the directory /etc/ld.so.conf.d/. To do this, first convert ...


0

Even though you only want to change the limit temporarily, the change must be done in a persistent way by creating /Library/LaunchDaemons/limit.maxproc.plist file, owned by root:wheel and permissions 644 with these contents: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ...


2

Option B is the preferred solution for both performance and portability reasons (see below), and I would probably read the entire contents of the file at once String content = new Scanner(new File(“filename”)).useDelimiter(“\Z”).next(); (from this StackOverflow answer) You should handle I/O errors caused by the file not being present, and reading it when ...



Top 50 recent answers are included