Main

IDE Archives

September 21, 2009

ClassNotFound: How To Find The Missing Library


There are numerous ADF libraries and it may cause you problems to resolve a ClassNotFound exception.
To help you in finding the missing library, there is a small search utility in the "Add Library" and the "Manage Libraries" dialogs as shown in the next figure:

ManageLibrariesSearchClassName.png


You can reduce the number of libraries shown, or search for a library by entering a string. You can enter

  • the exact class name,
  • a fully qualified name,
  • a partial class or package name, using * as a wildcard anywhere in the string

.

June 17, 2008

How To Delete An Entire Workspace Or Project?


A customer asked me how to delete an entire Workspace from JDeveloper 10.1.3.
He had selected his workspace and then selected the menu "File" -> "Erase From Disk"
The corresponding JWS file was removed, but not its content (Projects).

That's indeed the way the "Erase From Disk" works:
it only deletes the selected object from the OS;

in case of a Workspace or a Project, you delete the corresponding JWS file or JPR file only.
JDeveloper doesn't delete their content recursively.


...

If you delete an application or a project, only the .jws or .jpr file is actually deleted. The

elements contained within the application or project remain on disk. To delete them from disk

through JDeveloper, you must do so explicitly.

So, you have to delete the content of the Workspace or Project manually after you selected "Erase From Disk" in JDeveloper.

December 8, 2007

Specify which editor tool will be opened for a particular file type.


This question comes regularly in the forums and in Support.
How to change the editor tool for a particular file type ?
F.ex. you would like to open the JSP files with the 'Source' tab as default, instead of the 'Design' tab.
It's very easy to do it ... when you know how to do it.

You have to select menu Tools -> Preferences....
There select "File Types" on the left Panel.
On the right panel, click tab "Default Editors"

Select a File Type and change its default editor.
In the following example, I specify I would like to open the JSP files in the Source editor:
DefaultEditor:

March 10, 2007

Certified and Supported Migration Paths for JDeveloper


I was asked if one could migrate from JDeveloper 9.0.4.3 to JDeveloper 10.1.3.2.0
Answer is "No" - it's not supported.

For more information about the Supported Migration Paths, see the following document published on OTN:
Certified and Supported Migration Paths for JDeveloper

In case you need to use an intermediate version for your migration, you can download old versions of JDeveloper from [Here]

November 29, 2006

Event and Execution Profilers in JDeveloper


See part of Shay Shmeltzer's presentation at OOW about "Better Java Code", where he showed the
usage of the built-in profilers in JDeveloper to tune an application.

Click [Here] to access his blog and [Here] to view the demo.

November 27, 2006

Another Example of Code Template


I had already blogged about the Code Templates - see "conn, ife, sop & try".
Jan Vervecken gives a useful example of Code Template in OTN: "nice Code Template for log statements".

You can define "sopcm" as the shortcut of the following code template:

System.out.println("Current Class: $theCurrentClass$ - Current Method: $theCurrentMethod$");
as shown in the next figure:
sopcm_1:


and declare 2 variables theCurrentClass and theCurrentMethod of type curClass and curMethod respectively:
sopcm_3:

Then in the Code Editor, enter sopcm and press CTRL + ENTER
It will add the following code automatically (in this example, it was added in method getDepartmentsView1 of the class AppModuleImpl):
System.out.println("Current Class: AppModuleImpl - Current Method: getDepartmentsView1");

November 24, 2006

"Toggle Line Comments" Accelerator Does Not Work on All Keyboards


In the JDeveloper Code Editor, you can select lines and toggle the comments by selecting the menu Source -> Toggle Line Comments.
The corresponding accelerator key is CTRL+/, but it doesn't work for all keyboards.
For example, on my Belgian keyboard, there is no "/" key. The "slash" can only be accessed by pressing simultaneously the SHIFT and ":" ("colon") keys:
ShiftColon:

To have the accelerator working correctly, you should redefine the accelerator keys mapped to the "Toggle Line Comments" action:
Select menu Tools -> Preferences...
In the Preferences dialog select Accelerators and under Actions select Toggle Line Comments.
Click Remove to remove the current accelerators:
Accelerator_1:

Then click the New Accelerator field and press the keys you would like to associate to the action.
For example, CTRL + SHIFT + :  (CTRL + SHIFT + Colon)
The field New Accelerator will display the keys you pressed.
You can then click Add:
Accelerator_2:

and your accelerator is now defined:
Accelerator_3:

Click OK
The Toggle Comment Lines accelerator will now work.

November 22, 2006

Defining the Tab Size in JDeveloper 10.1.3


In JDeveloper 10.1.2, you could specify that space characters, rather than tab characters, should be used for tab settings when you pressed the Tab key.
You could also determine the "Tab Size" (number of space characters added when pressing the Tab key).
This was done through Tools -> Preferences... in the Code Editor as shown here:
TabSizeJDev1012:


In JDeveloper 10.1.3 however, the same dialog doesn't include this option:
CodeEditorJDev1013:


To specify it in JDeveloper 10.1.3, you should specify it through Tools -> Preferences... in the Code Style (the entry just below Code Editor):
CodeStyle1013:


If you click the Edit... button, you'll access the different settings for Indentation:
TabSizeJDev1013:


October 26, 2006

Code Assist and Audit Rules


You probably know the Code Assist in JDeveloper.
It examines your code in the editor, and provides
assistance to fix common problems.
For example, it identifies a parameter that is not used in your code, and proposes as fix to remove it

JDevAuditWarning:

When your code complies with all the rules, then a green square is displayed in the upper-right corner of the code editor.
When there are errors, the square is red; finally, it's orange when there are warnings (as shown above).

An interesting question was posted in the JDeveloper Forum on OTN:
Is it possible to configure JDeveloper to ignore some warnings or errors ?

Answer is Yes:

  1. Select menu Tools -> Preferences

  2. In the left Pane, expand Audit and select  Profiles

  3. In the right Pane, under tab Rules (selected by default), expand Usages

  4. Select Unused Parameters.
    NB: You can see an explanation on the rule you selected in the lower part of the screen.

  5. Unselect this rule and click OK:
    JDevAuditUnusedParam:

  6. You can then click the Save As... button and give a meaningful name

Another option (and better in my opinion) is to keep the rule selected, but change the Severity and Style (right part of the dialog).
You can set the Severity=Advisory and the Style=Warning.
With this setting, no warning/error will be shown (green square), but the unused parameter will be underlined to indicate there is a Quick Fix available (Removed Unused Parameter):

JDevAuditAssistQuickFix:


October 23, 2006

Angel food cake


They made it again :-) ...

After the "Microwave Safety", here is the "Angel food cake" Productivity Hint in JDeveloper:

AngelFoodCake:

Related blogs:

July 3, 2006

How To Open the JSP Files in the Source Tab instead of the Visual Editor


This is a regular request we get in the OTN Forum:

how to set JDeveloper to open the JSP files in the Source Editor instead of the Visual (Design) Editor ?

This can be done by changing the IDE preferences;

Select menu Tools | Preferences...

Select File Types in the left panel.

On the right, click tab Default Editors

Select the type of file you want to change (JSP Source in this case).

Select 'Source' in the Default Editor and click OK.
Opening a file of this type will open it in the Source Editor from now.

Preferences_FileType:


June 17, 2006

conn, ife, sop & try


conn
, ife, sop & try
Oh, weird
language, isn't it.
These are the code templates I use
most often.

A code template is a nice feature of
JDeveloper.
You type a shortcut, eg try, followed by the

CTRL+Enter
key combination and the equivalent template code
is added in the source editor,
at the point where your cursor was.
It
will also bring any associated imports.

For example,
typing conn in the source editor followed by the

CTRL+Enter
key combination will add the following code:

String username = "scott";
String password = "tiger";
String thinConn = "jdbc:oracle:thin:@localhost:1521:ORCL";
DriverManager.registerDriver(new OracleDriver());
Connection conn = DriverManager.getConnection(thinConn,username,password);
conn.setAutoCommit(false);
return conn;
and the following imports:
import java.sql.*;
import oracle.jdbc.OracleDriver;

I think it's worth you have a look at all the avalable shortcuts:
select menu Tools --> Preferences..., expand  Code Editor and click  Code Templates.
You can see there the shortcuts with a small description.
Selecting any shortcut displays the code as shown in the followin picture:

CodeTemplates:


I had never defined my own template before, but I'll certainly do, after having read Frank's post in his blog:
How to automatically add the class name and creation date to a Java file

Frank explains there how you can create your own template, and take advantage of variables (new in JDeveloper 10.1.3).
In his example, a variable $file$ will automatically get assigned the name of the Class and $date$ the current date.

By googling, I see that Steve also explained How to Create a Code Template for JSTL Choose.
Great !

May 23, 2006

IllegalStateException Displayed in the Log Window

When you re-run or re-debug an application in JDeveloper without stopping the embedded OC4J,
you may get a java.lang.IllegalStateException displayed in the Log window:
This error can be ignored.
To avoid it, just stop the Embedded OC4J Server after you tested or debugged your application.

For more detail, read this article.

May 22, 2006

JDeveloper Service Update 3 available.

JDeveloper Service Update 3 is now available on OTN.
See the JDeveloper Service Update 3 page [Here]


The most important fix in this patch concerns the mysterious disappearing files problem.

May 3, 2006

How to add JDK 1.5 API Reference to JDeveloper 10.1.3

In prior releases of JDeveloper, the Help menu included the J2SE API Reference:

MenuJ2SEAPIReference:

Several customers asked us why it's missing from JDeveloper 10.1.3 and if it's possible to restore it in the IDE.
For details, see [Here].

May 2, 2006

The debugger only displays the first 100 characters in String variables

Steve writes in a comment:

"(...) if you look at a string in the debugger trace window, it is truncated..
so if you happen to have a very long sql statment in hte string , or cannot view it, or even edit it"

Indeed, that's correct: as for any array, the debugger will only show 100 elements at a time, for performance reasons, as it may be very expensive to send an unlimited value from the debuggee process to the debugger.

However, you can see the whole String value and edit it.
See more in this article.

March 27, 2006

Microwave Safety

Aluminum foil pierced by a fork on a bed of ball bearings is not microwave safe.

You would expect this warning in a microwave manual, wouldn't you ?

Well, it was the "Tip of the Day" when I started up JDeveloper this morning:


Microwave Safety: <span style="font-weight: bold;"><br></span>

I'm not sure this one will increase my productivity.
At least, it will protect my microwave    ;-)

About IDE

This page contains an archive of all entries posted to Didier's Blog in the IDE category. They are listed from oldest to newest.

Firefox is the previous category.

JSP is the next category.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle