Do you often switch between different JDK version? Do you build JavaFX projects with early preview builds? Then JSelect is for you!
On many platforms it’s a bad habbit to install every JDK (even preview builds) at a global place such as C:\Program Files. Users add global JAVA_HOME environment variables to the system. On windows it is quite common to use the system preferences to change the PATH variable andJAVA_HOME to match the Java version that shall be used. The UI for adding or changing environment variables on Windows is horrible!
If you often switch between different versions then this is very time consuming. What if you’d like to use different JDK versions at once? What if the JDK you’d like to use is not installed to a global place such as C:\Program Files?
To solve the issues I had with Java and environment variables, I wrote a small tool that allows to easily switch between different JDK versions. After choosing the JDK it opens a command-line window (cmd.exe on Windows and xterm on Linux/OS X). Just specify a JDK and click Open CMDto open a command-line window that uses local JAVA_HOME and PATH variables that match the selected JDK. JSelect can also save/load configurations.
This is how it looks like (JDK 6 and JDK 8 in different cmd windows):
That’s great if you want to trigger Gradle builds from the command-line.
RESTfularchitecture is the most popular form of Internet software architecture.It is clearly structured, standards-compliant, easy to understand, easy to expand, so the site is being used more and more.
Google Protocol Buffer (referred Protobuf)is a mixed-language Google's internal data standards, is a lightweight and efficient structured data storage format that can be used to structure data serialization, or serialized.It is very suitable for data storage orRPCdata exchange format.Can be used for communication protocols, data storage and other areas of language-independent, platform-independent, scalable serial data format structure.Currently providesC + +, Java, Pythonthree languages of the API.
tomcat Servletcontainer to the market share of the first and well-known, so this paper spoke of how to useJersey, Google PB, Tomcatthese three magic weapons development REST-styleWEB service.
Two environmental structures
jersey version: jersey-archive-1.2-SNAPSHOT Google PB Version: protobuf-2.3.0 tomcat: tomcat6.0 Eclipse: 3.5.1 + tomcat plug in: http://www.eclipsetotale.com/tomcatPlugin.html
Three projects since lib
sm-3.1.jar jersey-server-1.2-SNAPSHOT.jar jackson-core-asl-1.1.1.jar jersey-spring-1.2-SNAPSHOT.jar jersey-client-1.2-SNAPSHOT.jar jettison-1.1.jar jersey-core-1.2-SNAPSHOT.jar jsr311-api-1.1.1.jar jersey-json-1.2-SNAPSHOT.jar protobuf-java-2.3.0.jar Please jersey of the package and the package to find the pb the lib
Four hands 4.1 Create a tomcat project in Eclipse,
The Eclipse workspace for the D :/ workspace:
addressbook.proto pb comes with the phone message definition file compile.bat build scripts to write their own message protoc.exe pb compiler command-line tool ContactClient.java access REST service's client-side code CreatePerson.java generate Person PB write their own structure, and there is D: root directory gadget category AddressBookResource REST Service Core Resource Class HelloResource.java Hello world Resource Class AddressBookStore.java wrote a phonebook storage class server segment to D :/ addressBooks.txt to store files AddressBookProtos.java addressbook.proto been compiled PB command-line tool to generate java class ProtobufMessageBodyReader.java server sends Request input streams into PB structures Provider class for the user to wear on a byte-stream into the PB structure ProtobufMessageBodyWriter.java server into the PB institutions output stream Provider class for the PB structure into a byte stream output to the user
5.2 Running CreatePerson generate Person and written to disk:
View D: root directory, discover new generation hery.per file.
5.3 Start tomcat (I was on the point under the Eclipse kitten) 5.4 Run ContactClient, perform the following results
his shows that we uploaded successfully, and can query by name. D root directory, while generating a file addressBooks.txt, this is the place to keep the phonebook server segment.