Java
J’utilise pour ma part NetBeans comme IDE (un autre équivalent est le bien connu Eclipse, que je ne connais que très peu)
Généralités
- Developpez.com (tutoriels, outils, api,…) : http://java.developpez.com/
-
Ubuntu.fr: http://doc.ubuntu-fr.org/java
-
Verify the Java Version
java -version -
Check Installed Java Versions
update-alternatives --config java -
Set the Default Java Version
sudo update-alternatives --config java
Log
- http://imss-www.upmf-grenoble.fr/prevert/Prog/Java/CoursJava/fichierDeLogs.html
- http://cyberzoide.developpez.com/java/logging/
Librairies
| Nom | Description | Documentation | Download |
|---|---|---|---|
| SQLite JDBC Driver | SQLite | https://github.com/xerial/sqlite-jdbc | |
| MySQL Connector/J | MySQL | - Tutoriel | http://dev.mysql.com/downloads/connector/j/5.1.html |
| Apache Commons Net | FTP, Telnet, POP3, FTP, SMTP, … | - Exemples - Exemple upload/download FTP - FTP Binary mode |
http://commons.apache.org/net/download_net.cgi |
| JSch - Java Secure Channel | SSH | http://www.jcraft.com/jsch/ | |
| javax.comm | Ports Série (serial port) | - Tutoriel - Tuto en anglais - utile ? - Windows Installation Guide |
|
| Jaudiotagger | MP3 ID3 tag (2011-?) | Autres librairies (outdated) : - mp3agic (2010-2011) - entagged (2003-2006) - javamusictag (2003-2006) |
|
| Java Excel API (jxl) | Excel | - Tutoriel A tester : http://poi.apache.org/ | |
| lastfm-java | Last.fm API bindings for Java | ||
| JLayer | MP3 decoder/player/converter library for Java™ platform. | ||
| ini4j | Java API for handling Windows ini file format | ||
| jCharts | Charts | See also: JFreeChart (a tester, plus compliqué mais plus puissant apparemment) | |
| coverartarchive-api | MusicBrainz Cover Art Archive API | To use a proxy: First, make DefaultCoverArtArchiveClient(HttpClient client) public in DefaultCoverArtArchiveClient class Then: DefaultHttpClient httpclient = new DefaultHttpClient();<br>HttpHost proxy = new HttpHost("xx.xx.xx.xx", 8080);<br>httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);<br>CoverArtArchiveClient client = new DefaultCoverArtArchiveClient(httpclient); |
|
| musicbrainzws2-java | Java binding for MusicBrainz XML Web Service/Version 2 | Autres librairies (to be tested) : - musicbrainz-data (Need to learn more about Spring framework and eventually Maven: forum issue) - javamusicbrainz |
|
| JAVE | Java Audio Video Encoder |
Runtime exec et Threads
- http://alwin.developpez.com/tutorial/JavaThread/
- Interruptions: http://java.developpez.com/faq/java/?page=langage_threads
- Interruptions: http://thecodersbreakfast.net/index.php?post/2009/06/08/G%C3%A9rer-proprement-les-interruptions-de-threads-en-Java
- http://ydisanto.developpez.com/tutoriels/java/runtime-exec/
- Passing a parameter to a thread: http://stackoverflow.com/questions/877096/how-can-i-pass-a-parameter-to-a-java-thread
Misc
Swing
String
| Description | Lien |
| Left-padding integers | http://stackoverflow.com/questions/473282/left-padding-integers-with-zeros-in-java |
| Date format | http://30minparjour.la-bnbox.fr/post/2010/petit-point-sur-simpledateformat |
En vrac (pour l’instant)
- Tableaux associatifs: http://www.chicoree.fr/w/Programmation_imp%C3%A9rative/Tableaux_associatifs
- http://download.oracle.com/javase/tutorial/index.html
- Overriding .equals():
- OnExit Event: http://stackoverflow.com/questions/2467070/onexit-event-for-a-swing-application
- Collections: http://fmora.developpez.com/tutoriel/java/collections/introduction/
- Overriding equals(): http://stackoverflow.com/questions/27581/overriding-equals-and-hashcode-in-java
- Look&Feel (a tester): http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- mime: http://www.rgagnon.com/javadetails/java-0487.html
- Cloner des objets: http://ydisanto.developpez.com/tutoriels/java/cloneable/
- Get User Name: http://www.rgagnon.com/javadetails/java-0048.html
- Group a List by property: http://vladzloteanu.wordpress.com/2009/05/20/java-lists-group-by-element-property-as-ruby-group_by-method/
- How to split a path platform independent?: http://stackoverflow.com/questions/1099859/how-to-split-a-path-platform-independent
- Maven behind proxy:
- Maven does not use Netbean’s nor system configured proxy
- You have to modify Maven’s settings.xml configuration file as described here: Lien mort
- On Windows, the file is located under C:\Program Files\NetBeans 7.0.1\java\maven\conf
Maven (A TESTER)
JAR Version
A étudier plus sérieusement
- http://stackoverflow.com/questions/1237084/netbeans-manifest
- http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html
- http://www.rgagnon.com/javadetails/java-0388.html
Include librairies in JAR
- Maven: in pom.xml, add the following lines in
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</plugin>
- Ant: in build.xml, add the following lines:
- The result will be an independent jar named finalApp.jar which includes, in this example, log4j library.
- “Main-Class” attribute should be set to what you have in Project Properties, under Run/Main Class:
- Note: “-post-jar” insures that this package build is made at the end, so expected files are present in dist folder
<target name="-post-jar">
<jar jarfile="dist/finalApp.jar">
<zipfileset src="${dist.jar}" excludes="META-INF/*" />
<zipfileset src="dist/lib/log4j-1.2.16.jar" excludes="META-INF/*" />
<manifest>
<attribute name="Main-Class" value="com.example.package.Main"/>
</manifest>
</jar>
</target>