Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!

Juhan Voolaid

Ranch Hand
+ Follow
since Nov 18, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Juhan Voolaid

(iron maiden - die with your boots on)
6 years ago
I also passed the SCJD exam. It has already been a month when I get the results. I wonder if I will receive a package from Sun (with diploma and other stuff) like it was with SCJP 5.0?
8 years ago
Yep. Without specifying any security policy and not doing that:
System.setSecurityManager(new RMISecurityManager());

... my application works without problems.
I have implemented a action class, that extends the AbstractAction and also I have associated a KeyStroke with that action.
So for example my OpenNewStuff action is triggered when Ctrl+O is pushed.

My problem is, that I want that the "Ctrl+O" binding information would be reflected in the Actions's name parameter.

Like for example in Firefox browser, when you push the "File" menu in the upper left corner, you see menu items labeled like so:
- New Window [space] Ctrl+N
- New Tab [space] Ctrl+T
- etc. ...

My OpenNewStuff action also is triggered by a menu item component and want the "Ctrl+O" to be added for the menu item's name.
How to do that correctly? Do I really have to set my actions name like that:
putValue(Action.NAME, "Open New Stuff" + " Ctrl+O"));

What about the space between? I think I cannot add "\t" character there.
8 years ago
Ok, found it.

The problem was, that I set new security manager in my code:
System.setSecurityManager(new RMISecurityManager());

Just had to delete it and it worked fine. I accidentally copied that code from RMI tutorial.
When I try to make a RMI connection with my client application, I get AccessControlException.
Solution for that would be configuring the security policy like that:
java -jar runme.jar

The client.policy file:

But the instructions clearly say that: "Your programs must not require use of command line property specifications".

So what are my options?

I have read that security policy is only required when the stubs are not provided, but I have included them - how do I test that anyway?

Roel De Nijs wrote:
What's the reason why you would use javac to compile your classes? Why don't take the easy road and use an IDE (or an Ant build file for example).

Want to do it by the book .
OK, figured it out.

Here is how I did:

javac -d classes -sourcepath src [path to the main class: src\rootPacket\]

The sourcepath tells the location form where to look for the dependencies (that the main class needs). Since all the classes are dependent on one another, they all get compiled. I am afraid that will not be the case, when there are classes in the source directory that are never used by other classes.
I am trying to compile my project using javac command line tool, but without success. As most of you, I use a powerful IDE when developing and don't bother myself with such a trivial task like it is compiling.

Now when I want to try and build a larger project than a few source files the first time, I don't want to believe that it is so complicated.

My project's file structure is something like that:

... etc

So I how do you compile all that. There can also be child2 and child102 in the packet hierarchy.

As I was hoping to execute these commands, I failed miserably:
javac -sourcepath src -d classes *.java
javac -sourcepath src/* -d classes *.java
javac -sourcepath src/** -d classes *.java
javac -d classes src/*/*.java

.. etc

So how to use javac, the arguments and wildcards correctly and intelligently. I don't want to type in all the package or source file names separately.
But check what I found on SUN web page:
Categories - Maximum points
General Considerations - 80
Documentation - 50
Object-Oriented Design - 50
GUI - 70
Locking - 80
Language Fluency - 70

paddy Mahadeva Iyer wrote:Not the exact same code! But the exact same error. But i found the solution also.

I need to specify the fully qualified path to my enum and the method i want to call.

That solved my problem!

I don't know how I should have known that. I see that syntax first time.
8 years ago
So I am taking like 30 minutes to write very detail technical stuff and once I press the "submit" button the forum kindly forwards me to log-in page. Flushing all my hard work down the toilet. So I am hoping to save it by navigating back but no use. What a bullcrap!

I am very pissed off.
8 years ago
Thank you Horry and Stevi for your explanation. And sorry for the confusing "Super" class name. It brought a bit confusion to this discussion aswell.