Intro
In java bin directory, there is a javascript engine, jjs.
JJS
The usage is pretty simple: Just go to the JDK instalatoin and run JJS ~ this was removed on OpenJDK 11 actually:
#jdk1.8.0_191/bin/jjs
jjs> print(‘Hello World!’);
Hello World!
In java bin directory, there is a javascript engine, jjs.
The usage is pretty simple: Just go to the JDK instalatoin and run JJS ~ this was removed on OpenJDK 11 actually:
#jdk1.8.0_191/bin/jjs
jjs> print(‘Hello World!’);
Hello World!
For later consulting:
[fdemeloj@fdemeloj bin]$ ls
/home/fdemeloj/Downloads/jdk1.8.0_191/bin
[fdemeloj@fdemeloj bin]$ ls
appletviewer javafxpackager jdb jrunscript pack200 unpack200
ControlPanel javah jdeps jsadebugd policytool wsgen
extcheck javap jhat jstack rmic wsimport
idlj javapackager jinfo jstat rmid xjc
jar java-rmi.cgi jjs jstatd rmiregistry
jarsigner javaws jmap jvisualvm schemagen
java jcmd jmc keytool serialver
javac jconsole jmc.ini native2ascii servertool
javadoc jcontrol jps orbd tnameserv
Learning a bit more about statical validation of JAVA code ~ as a counterpart for Lint my python scripts, then it would be unavoidable to look for issues on my code.
So as a first statical validation tool, the basic features below:
Running
You can run PMD in Windows and Linux, after installing, ofc. Below the running with basic quickstart rules that comes within the tool:
~~~
522 ./run.sh pmd -d /c/Users/TechPro/Desktop/lugano -rulesets rulesets/java/quickstart.xml,category/java/codestyle.xml > output1.txt
523 pmd -d /c/Users/TechPro/Desktop/lugano -f text -R rulesets/java/quickstart.xml> output2.txt
~~~
Creating/Changing Ruleset
After running sometimes you can see that some rules are not necessary, so then you edit the ruleset:
~~~
<rule ref=”rulesets/java/basic.xml/EmptyCatchBlock”
message=”Must handle exceptions”>
<priority>2</priority>
</rule>
~~~
Creating new rules
But then, you need to create some new rules, like this one here, which validates a string that I’m creating.
To create a new rule, basically just run the designer, which comes with bin directory of PMD. As below:
~~~
./run designer
~~~
To create the rule, you will need to create a rule on the XPath Expression, which is done by the AST tree validation, as below:

REFs
~
I already talked about Log4J, but not about SLF4J. The Simple Logging Facade for Java is another way
Using SLF4J for the first time:
import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HelloWorld { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(HelloWorld.class); logger.info("Hello World"); } }
migration
To migrate to SLF4J from log4J is quick simple since they have a migration tool, with some limitations though.
Tutorials
There are several tutorials on this matter.
Dependencies and underline logger framework
As the tutorial explains, if you use <sl4j-nop:175> you will basically only compile the project ~ getting rid of the sl4j issues.
But to actually use it, you must use logback-classic.jar and logback-core.jar, dependencies.
And in fact, you can stack sl4j above log4j, keeping the logger messages from both.
~ inline
Although there isn’t a specific answer on the documentation, there are some possible solutions.
-D comes from Define, as in define properties in C.
A quite interesting common thing that we experience called Netsplit , when the network sudden disconnect and this is explained as the disconnection:
The NETwork SPLIT as one of the IRC servers lost contact with the rest of the network. The server was split!
I think I already talked about this here ~ migrating from one version to other of a library.
~ Sometimes, for example NX lib, do not bring a detail release note, so, sometimes when migrating from one version to another, you will need to the brute forte way: compile against the new versions, see what breaks and test if it is actually working.
Get the source, compile it against the new lib source and see what breaks and what is deprecated.
There are other ways to migrate the source, for example, with the list of classes that actually change or by
–
When dealing with clients, sometimes some tips can be useful:
~ Explain several times if necessary
~ Be always polite even if the customer is wrong (I mean technically mislead)
~ Use the concepts of Politeness theory and face value
inline
From NYC to SF there are 44h of car or ~2.3k miles
Iowa
Des Moines
Nebraska
Omaha
Lincoln
Wyoming
Cheyenne
Utah
Salt Lake City
Nevada
Reno
California
Sacramento
SF