I have a little experience in C++ and Java, but I want to be professional with them. Also, when i want to develop a secure application, what is the recommended way?
I suggest you find a local community college and take a semester there.
You will need to be adept at the basics before you write secure programs.
You can learn by programming, taking a course, or reading a book on basic Java. I would recommend a mix of programming in Java and reading a book on it.
You need to be more specific for the other questions I am not sure what you are asking.
I would start by typing "java tutorial" into Google. Once you have the basics down you should look for sites and mailing lists that get more specific to the type of application you wish to create.
The Apache Software Foundation is a huge OS community and has a lot of Java libraries you can use.
With regard to security...It depends on your environment and what you are trying to secure. You need to be more specific with your question.
I don't know how much experience you have in C++, but assuming you've got a pretty good grasp of that language as well as object-oriented concepts, I recommend reading Head First Java - it's a really easy read and will catch you up with an overview of the language (including basic threading and sockets).
For information on building data structures or implementing algorithms using the Java language, I recommend Data Structures & Algorithms In Java. The books presentation is okay - some of the code is crunched on some pages, but the material is solid.
Lastly, the Java API is a great resource, in my opinion. I can't think of a time when I didn't find what I was looking for on that site. Personally, I think that if you read through Head First and then work on some personal projects and keep the Java API by your side you'll be good to go.
Watch these Java lectures from Stanford university. It's the whole course for free, and will teach you Java in great depth.
http://see.stanford.edu/see/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111
I find grabbing a book and trying is the best way. You really need a goal in mind - come up with a toy project that you would like to make, and just start doing it. This way you can learn from your mistakes, and get a feel for the language. This is assuming that you have a reasonably solid understanding of the basics of programming; if you don't then you might want to get a mentor - contact your local computer club, they might be able to suggest someone.
I always found doing the project euler problems in a new language an easy way to get started if you can't think of a simple toy project - http://projecteuler.net/
Although this question was asked by someone who wanted to improve java skills, I think the answers posted there are good for learning Java for the first time, as well. Like I said to answer the other question, it's all about Effective Java.
Don't miss the opportunity to use a Java-like interpreted language for hands-on testing and playing around with Java libaries. It can sometimes be much faster to try something out interactively at a prompt rather than writing full programs.
My favorites for this are:
BeanShell, http://www.beanshell.org Groovy, http://groovy.codehaus.org/
For security, The Art of Software Security Assessment by Down and McDonald and Schuh is sitting just to the left of my keyboard. Warning: It may take two people to lift this book. Also, somewhat narrower in field, Secure Coding in C and C++ by Seacord is worth a read.
The problem with learning Java (or blub, or programming language x) is not a shortage of reference material or information - it's a problem of knowing separating the good material (well-written, right level of challenge) from the inferior.
I've found Bruce Eckel's books (Thinking in Java, Thinking in C++) to be comprehensive and in-depth. They go well beyond an introductory level. Additionally they are freely available online. I'd also recommend "Effective Java" by Josh Bloch and "Java Concurrency in Practice" by Brian Goetz.
The only way to learn, of course, is to read code that is better than your own and to program with the intent of writing code that is better than code you have written before. Have some improvements in mind before you start coding - how are you going to handle exceptions? Will you take the time to research the right library functions for what you're going to do? Does the problem you're solving have a more elegant solution (perhaps a standard one?)
As others have mentioned, OSS projects provide a massive amount of code that you can read. Pick large and mature projects that have a good repuation in terms of code quality - take a small piece and read it until you understand it.