BowerStudios.com

  • My Lab
  • Family
  • Friends
  • Professional
  • About
Home » The Lab » Programming

Java

Customizing the version of Java used by default on a Mac

daniel —Thu, 11/06/2014 - 10:49am

To customize what version of Java is used by default on your mac (once you've installed another version of Java):
At the command line:
cd /System/Library/Frameworks/JavaVM.framework/Versions
sudo rm CurrentJDK
sudo ln -s /Library/Java/JavaVirtualMachines/jdk{version number here}.jdk/Contents CurrentJDK

For those updating their Macs to Yosemite it will revert the CurrentJDK symlink to the system default even if you have customized it.

Posting this because a friend needed it... I would never advocate using such a platform :)

  • Java
  • Read more about Customizing the version of Java used by default on a Mac
  • Log in to post comments

Verify Java Cryptography Extensions ( JCE ) installed

daniel —Mon, 08/04/2014 - 1:05pm

Verified by creating the following class

import javax.crypto.*;
import java.security.*;
public class JceTest {
public static void main (String[] args){
boolean isUnlimitedSupported = false;
try {
KeyGenerator kgen = KeyGenerator.getInstance("AES", "SunJCE");
kgen.init(256);
isUnlimitedSupported = true;
} catch (NoSuchAlgorithmException e){
isUnlimitedSupported = false;
} catch (NoSuchProviderException e) {
isUnlimitedSupported = false;
}
System.out.println("isUnlimitedSupported=" + isUnlimitedSupported);
}
}

and running: javac JceTest.java; java JceTest

from: Stack Overflow

  • Groovy
  • Java
  • Read more about Verify Java Cryptography Extensions ( JCE ) installed
  • Log in to post comments

Options for working with Xml in Java by mkyong

daniel —Thu, 06/12/2014 - 10:29am

Java XML Tutorial and How to read UTF-8 XML file in Java – (SAX Parser)

  • Groovy
  • Java
  • Read more about Options for working with Xml in Java by mkyong
  • Log in to post comments

SpringOne 2GX highlights

daniel —Fri, 05/02/2014 - 5:58pm

from Thomas Lin

  • Groovy
  • Java
  • Read more about SpringOne 2GX highlights
  • Log in to post comments

Google's Style guide for Java

daniel —Fri, 05/02/2014 - 5:57pm

  • from google.github.io
  • Java
  • Read more about Google's Style guide for Java
  • Log in to post comments

Import OpenSSL certificate into java keystore on Ubuntu

daniel —Mon, 04/21/2014 - 11:28am

First Step:
Convert the cert into a Java Keystore:
openssl pkcs12 -export -name mycert.local -in /etc/ssl/certs/mycert.local.cert -inkey /etc/ssl/private/mycert.local.key -out mycert.local.keystore.p12

Second Step:
Import the new keystore (Using the primary java keystore of an Oracle Java install on Linux here:
keytool -importkeystore -srckeystore mycert.local.keystore.p12 -destkeystore /usr/lib/jvm/default-java/jre/lib/security/cacerts -srcstoretype pkcs12

  • Linux
  • Groovy
  • Java
  • Read more about Import OpenSSL certificate into java keystore on Ubuntu
  • Log in to post comments

Java / Grails Application Metrics

daniel —Wed, 04/09/2014 - 10:49am

Interesting Metrics Libraries:

  • Grails Yammer Metrics
  • Yammer on Javacodegeeks.com
  • Yammer metrics docs
  • Grails Melody plugin
  • Java Melody Monitoring
  • Groovy
  • Java
  • Read more about Java / Grails Application Metrics
  • Log in to post comments

Intermediate Debugging in Eclipse

daniel —Tue, 02/11/2014 - 3:20pm

Debugging with eclipse tips from codecentric.de

Particularly useful to me were the sections:
Navigation: Drop to Frame, Variables View: Show Logical Structure

The stuff on Detail Formatters was useful as well.

Note that Eclipse will truncate long strings in the detail view, but you can increase this limit. However, with very large values, you'll find it much easier to change the underlying code adding a log statement due to the detail view being really slow to render.

  • Groovy
  • Java
  • Read more about Intermediate Debugging in Eclipse
  • Log in to post comments

Deploy to Archiva from Grails

daniel —Fri, 01/03/2014 - 2:01pm

In your ~/.grails/settings.groovy

String archivaUsername = "daniel"
String archivaPass = ""
String archivaHost = "myArchivaHost.bowerstudios.com"
grails.project.ivy.authentication = {
credentials {
realm = "Repository Archiva Managed releases Repository"
host = archivaHost
username = archivaUsername
password = archivaPass
}
}
grails.project.repos.bowerStudiosArchiva.url = "http://${archivaHost}/archiva/repository/releases"
grails.project.repos.bowerStudiosArchiva.username = archivaUsername
grails.project.repos.bowerStudiosArchiva.password = archivaPass
grails.project.repos.default = "bowerStudiosArchiva"

Then, as long as you have the release plugin installed:
To install to your local maven cache:
grails maven-install
To install to Archiva:
grails maven-deploy

  • Groovy
  • Java
  • Read more about Deploy to Archiva from Grails
  • Log in to post comments

SSL keys to java keystore

daniel —Thu, 12/26/2013 - 3:24pm

Created a private key and cert request using openssl. Sent it off to get a Rapid ssl cert, and had to do the following:

Concatenate the primary and secondary ca certs with the cert issued by rapid ssl:
cat primary_inter.cer secondary_inter.cer host.bowerstudios.com.cert > certs.cert

Next, I used openssl to create a "combined store"
openssl pkcs12 -export -in certs.cert -inkey host.bowerstudios.com.key -certfile certs.cert -name host.bowerstudios.com -out host.bowerstudios.com.p12

Now, import the keystore into a java keystore
keytool -importkeystore -srckeystore host.bowerstudios.com.p12 -srcstoretype pkcs12 -destkeystore tomcat.keystore -deststoretype JKS

  • Groovy
  • Java
  • Read more about SSL keys to java keystore
  • Log in to post comments

Pages

  • « first
  • ‹ previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • …
  • next ›
  • last »
Subscribe to RSS - Java

Navigation

  • Search
  • Recent content
  • Contact Me
  • Mail
  • Pass Hasher
  • Bower Studios Admin

Quotes

daniel —Thu, 06/03/2010 - 9:09am

Choice of words is important. Shorter is usually better. But if you have to explain what "x" means to many of your users--or worse, to your teammates--then you should probably replace "x" by whatever you said to explain it.

—

Larry Tesler

http://www.designingforinteraction.com/tesler.html

  • Log in to post comments
  • daniel's quotes

Popular content

Last viewed:

  • Quote
  • Unix commands
  • Debugging SSL issues on Java
  • Sonatype Nexus and Hudson on Tomcat on OpenBSD
  • Ohio

Copyright 2019 Daniel Bower
  • My Lab
  • Family
  • Friends
  • Professional
  • About