Including all the jars in a directory within the Java classpath

Using Java 6 or later, the classpath option supports wildcards. Note the following: Use straight quotes (“) Use *, not *.jar Windows java -cp “Test.jar;lib/*” my.package.MainClass Unix java -cp “Test.jar:lib/*” my.package.MainClass This is similar to Windows, but uses : instead of ;. If you cannot use wildcards, bash allows the following syntax (where lib is … Read more

How to pass command line arguments to a rake task

You can specify formal arguments in rake by adding symbol arguments to the task call. For example: require ‘rake’ task :my_task, [:arg1, :arg2] do |t, args| puts “Args were: #{args} of class #{args.class}” puts “arg1 was: ‘#{args[:arg1]}’ of class #{args[:arg1].class}” puts “arg2 was: ‘#{args[:arg2]}’ of class #{args[:arg2].class}” end task :invoke_my_task do Rake.application.invoke_task(“my_task[1, 2]”) end # … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)