How to list all available classes?
Hi *,
Is there a possibility to list all the classes available to the JVM? I would like to have a list like this:
java.lang.String
java.util.Vector
and so on.
koem
Good joke, but that is not what I meant :)
I would like to get all the class-names at runtime. Because this list depends on the classpath it can be different with every invocation of the my program.
Similar Messages
-
How to list all available tables for user "karl"
How can I list all available tables (=table names) for user "karl"?
Nice to have would be if (after each table name in another column of each row) the number of data rows in this table can be listed similar to:
TABLE NUM ROWS
TESTA 12
TESTB 3455
ANOTHERTAB 234
How can I do this?from Laurent Schneider
http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html
SQL> select
2 table_name,
3 to_number(
4 extractvalue(
5 xmltype(
6 dbms_xmlgen.getxml('select count(*) c from '||table_name))
7 ,'/ROWSET/ROW/C')) count
8 from user_tables;
TABLE_NAME COUNT
DEPT 4
EMP 14
BONUS 0
SALGRADE 5 -
List all available classes in all class loaders
How can I create a list of all of the classes available to all of the class loaders of the current JVM?
Thanks in advance,
AsafI would like to create a mechanism that would enumerate all the classes which are extending a certain other class.
public class Cls1 : ClsBase{
public class Cls2 : ClsBase{
public class Cls3 : Object{
}In this case, i would like to get a list with Cls1 and Cls2 in it. -
How to list all available backup sets
Hi,
we are using Oracle 11gR2. there is an requirement to list all avilable backup sets through shell scripts, we have retention period of 15days.
below query gives me list of backup files but it was difficult to know which files was require for "catalog backuppiece"
DBMS_RCVMAN.SETDATABASE(null,null,null,1536975101,null);
SELECT PKEY,FNAME ,BS_COMPLETION_TIME
FROM RMAN.RC_BACKUP_FILES
where
file_type='PIECE'
AND
STATUS = 'AVAILABLE';Backup sets looks below on Disk. all files starting with *"db11g_c-"* are required for catalog backuppiece.
we like to know is there another better way to get this information. we want to list only those files required for cataloging.
-rw-r----- 1 oracle asmadmin 38M Sep 30 02:30 backup_ADB_DB_30092010_25lp5hle_1_1_69
-rw-r----- 1 oracle asmadmin 285M Sep 30 02:32 backup_ADB_DB_30092010_26lp5hm7_1_1_70
-rw-r----- 1 oracle asmadmin 145K Sep 30 02:32 backup_ADB_DB_30092010_27lp5hpr_1_1_71
-rw-r----- 1 oracle asmadmin 9.4M Sep 30 02:32 db11g_c-1536975101-20100930-00
-rw-r----- 1 oracle asmadmin 38M Oct 1 02:30 backup_ADB_DB_01102010_29lpaqdi_1_1_73
-rw-r----- 1 oracle asmadmin 286M Oct 1 02:32 backup_ADB_DB_01102010_2alpaqeb_1_1_74
-rw-r----- 1 oracle asmadmin 125K Oct 1 02:32 backup_ADB_DB_01102010_2blpaqi9_1_1_75
-rw-r----- 1 oracle asmadmin 9.4M Oct 1 02:32 db11g_c-1536975101-20101001-00
-rw-r----- 1 oracle asmadmin 38M Oct 2 02:30 backup_ADB_DB_02102010_2dlpdepj_1_1_77
-rw-r----- 1 oracle asmadmin 287M Oct 2 02:32 backup_ADB_DB_02102010_2elpdeqd_1_1_78
-rw-r----- 1 oracle asmadmin 169K Oct 2 02:32 backup_ADB_DB_02102010_2flpdeub_1_1_79
-rw-r----- 1 oracle asmadmin 9.4M Oct 2 02:32 db11g_c-1536975101-20101002-00
-rw-r----- 1 oracle asmadmin 48M Oct 3 02:30 backup_ADB_DB_03102010_2hlpg35h_1_1_81
-rw-r----- 1 oracle asmadmin 288M Oct 3 02:32 backup_ADB_DB_03102010_2ilpg36l_1_1_82
-rw-r----- 1 oracle asmadmin 123K Oct 3 02:32 backup_ADB_DB_03102010_2jlpg3aj_1_1_83
-rw-r----- 1 oracle asmadmin 9.4M Oct 3 02:32 db11g_c-1536975101-20101003-00
-rw-r----- 1 oracle asmadmin 48M Oct 4 02:30 backup_ADB_DB_04102010_2llpinhk_1_1_85
-rw-r----- 1 oracle asmadmin 290M Oct 4 02:32 backup_ADB_DB_04102010_2mlpinio_1_1_86
-rw-r----- 1 oracle asmadmin 177K Oct 4 02:32 backup_ADB_DB_04102010_2nlpinmc_1_1_87
-rw-r----- 1 oracle asmadmin 9.4M Oct 4 02:32 db11g_c-1536975101-20101004-00
-rw-r----- 1 oracle asmadmin 2.9M Oct 4 05:26 backup_ADB_DB_04102010_2plpj1s3_1_1_89
-rw-r----- 1 oracle asmadmin 289M Oct 4 05:28 backup_ADB_DB_04102010_2qlpj1s4_1_1_90
-rw-r----- 1 oracle asmadmin 13K Oct 4 05:28 backup_ADB_DB_04102010_2rlpj1vp_1_1_91
-rw-r----- 1 oracle asmadmin 9.4M Oct 4 05:28 db11g_c-1536975101-20101004-01
-rw-r----- 1 oracle asmadmin 7.0K Oct 4 05:29 backup_ADB_DB_04102010_2tlpj21q_1_1_93
-rw-r----- 1 oracle asmadmin 3.0K Oct 4 05:29 backup_ADB_DB_04102010_2vlpj223_1_1_95
-rw-r----- 1 oracle asmadmin 289M Oct 4 05:36 backup_ADB_DB_04102010_2ulpj21r_1_1_94
-rw-r----- 1 oracle asmadmin 150K Oct 4 05:37 backup_ADB_DB_04102010_31lpj2gv_1_1_97
-rw-r----- 1 oracle asmadmin 289M Oct 4 05:37 backup_ADB_DB_04102010_30lpj22h_1_1_96
-rw-r----- 1 oracle asmadmin 9.4M Oct 4 05:37 db11g_c-1536975101-20101004-02
-rw-r----- 1 oracle asmadmin 8.0K Oct 4 05:37 backup_ADB_DB_04102010_33lpj2h7_1_1_99
-rw-r----- 1 oracle asmadmin 9.4M Oct 4 05:38 db11g_c-1536975101-20101004-03
-rw-r----- 1 oracle asmadmin 2.8M Oct 4 08:00 backup_ADB_DB_04102010_36lpjase_1_1_102
-rw-r----- 1 oracle asmadmin 290M Oct 4 08:02 backup_ADB_DB_04102010_37lpjasi_1_1_103
-rw-r----- 1 oracle asmadmin 270K Oct 4 08:02 backup_ADB_DB_04102010_38lpjb0g_1_1_104
-rw-r----- 1 oracle asmadmin 9.4M Oct 4 08:02 db11g_c-1536975101-20101004-04
-rw-r----- 1 oracle asmadmin 215K Oct 4 08:14 backup_ADB_DB_04102010_3alpjbnl_1_1_106
-rw-r----- 1 oracle asmadmin 291M Oct 4 08:16 backup_ADB_DB_04102010_3blpjbnm_1_1_107
-rw-r----- 1 oracle asmadmin 110K Oct 4 08:16 backup_ADB_DB_04102010_3clpjbrl_1_1_108
-rw-r----- 1 oracle asmadmin 9.4M Oct 4 08:16 db11g_c-1536975101-20101004-05
-rw-r----- 1 oracle asmadmin 34M Oct 5 02:30 backup_ADB_DB_05102010_3elplbtg_1_1_110
-rw-r----- 1 oracle asmadmin 291M Oct 5 02:32 backup_ADB_DB_05102010_3flplbu0_1_1_111
-rw-r----- 1 oracle asmadmin 27K Oct 5 02:32 backup_ADB_DB_05102010_3glplc1a_1_1_112
-rw-r----- 1 oracle asmadmin 9.4M Oct 5 02:32 db11g_c-1536975101-20101005-00
-rw-r----- 1 oracle asmadmin 33M Oct 6 02:30 backup_ADB_DB_06102010_3ilpo09f_1_1_114
-rw-r----- 1 oracle asmadmin 291M Oct 6 02:32 backup_ADB_DB_06102010_3jlpo09u_1_1_115
-rw-r----- 1 oracle asmadmin 22K Oct 6 02:32 backup_ADB_DB_06102010_3klpo0dt_1_1_116
-rw-r----- 1 oracle asmadmin 9.4M Oct 6 02:32 db11g_c-1536975101-20101006-00Edited by: Sachin B on Oct 6, 2010 2:50 AMi got the solution :)
EXEC DBMS_RCVMAN.SETDATABASE(null,null,null,1536975101,null);
SELECT PKEY,FNAME ,BS_COMPLETION_TIME
FROM RMAN.RC_BACKUP_FILES
where
file_type='PIECE'
AND
STATUS = 'AVAILABLE'
AND
BS_KEY IN
(SELECT BS_KEY FROM RC_BACKUP_SET where db_id='1536975101' AND CONTROLFILE_INCLUDED='BACKUP'); -
How to search for available class in given package?
How to search for available class in given package or sub package?
Finally i did it. I make hibernate and spring without much configuration. I just pass the package pattern to search for all bean. I named it package pattern injection.
My website is still under construction yet. It named Jimmy6 Framework.
The code it just the following for all hibernate and spring bean for the whole project.
<bean id="sessionFactory" class="com.j6.framework.JAnnotationSessionFactoryBean">
<property name="annotatationOrHbmXmlPackagePattern">
<list>
<value>com\.j6\.project.+?\.vo\..+?</value>
</list>
</property>
<bean id="autoBeanCreatorFactoryManager" class="com.j6.framework.resource.AutoBeanCreatorFactory">
<property name="packagePatterns">
<list>
<value>com\.j6\.project\..+?\.manager\..+?</value>
</list>
</property>
</bean>
<bean id="autoBeanCreatorFactoryDao" class="com.j6.framework.resource.AutoBeanCreatorFactory">
<property name="packagePatterns">
<list>
<value>com\.j6\.project\..+?\.dao\.hibernate.+?</value>
</list>
</property>
</bean>Feel free to have a look and gv some comments. Thanks :)
Regards,
Jimmy6
Edited by: jimmy6 on Nov 4, 2008 8:15 AM -
How to list all properties in the default Toolkit
I would like to know what kinds of properties are stored in the default Toolkit (Toolkit.getDefaultToolkit()). I don't know how to list all of them. Toolkit class has a method getProperty(String key, String defaultValue), but without knowing a list of valid keys, this method is useless.
Any idea would be appreciated.Here is a little utility that I wrote to display all the UIDefaults that are returned from UIManager.getDefaults(). Perhaps this is what you are looking for?
import javax.swing.*;
import java.util.*;
public class DefaultsTable extends JTable {
public static void main(String args[]) {
JTable t = new DefaultsTable();
public DefaultsTable() {
super();
setModel(new MyTableModel());
JFrame jf = new JFrame("UI Defaults");
jf.addWindowListener(new WindowCloser());
jf.getContentPane().add(new JScrollPane(this));
jf.pack();
jf.show();
class MyTableModel extends javax.swing.table.AbstractTableModel {
UIDefaults uid;
Vector keys;
public MyTableModel() {
uid = UIManager.getDefaults();
keys = new Vector();
for (Enumeration e=uid.keys() ; e.hasMoreElements(); ) {
Object o = e.nextElement();
if (o instanceof String) {
keys.add(o);
Collections.sort(keys);
public int getRowCount() {
return keys.size();
public int getColumnCount() {
return 2;
public String getColumnName(int column) {
if (column == 0) {
return "KEY";
} else {
return "VALUE";
public Object getValueAt(int row, int column) {
Object key = keys.get(row);
if (column == 0) {
return key;
} else {
return uid.get(key);
class WindowCloser extends java.awt.event.WindowAdapter {
public void windowClosing(java.awt.event.WindowEvent we) {
System.exit(0);
} -
How to list all files in a given directory?
How to list all the files in a given directory?
A possible recursive algorithm for printing all the files in a directory and its subdirectories is:
Print the name of the directory
for each file in the directory:
if the file is a directory:
Print its contents recursively
else
Print the name of the file.
Directory "games"
blackbox
Directory "CardGames"
cribbage
euchre
tetris
The Solution
This program lists the contents of a directory specified by
the user. The contents of subdirectories are also listed,
up to any level of nesting. Indentation is used to show
the level of nesting.
The user is asked to type in a directory name.
If the name entered by the user is not a directory, a
message is printed and the program ends.
import java.io.*;
public class RecursiveDirectoryList {
public static void main(String[] args) {
String directoryName; // Directory name entered by the user.
File directory; // File object referring to the directory.
TextIO.put("Enter a directory name: ");
directoryName = TextIO.getln().trim();
directory = new File(directoryName);
if (directory.isDirectory() == false) {
// Program needs a directory name. Print an error message.
if (directory.exists() == false)
TextIO.putln("There is no such directory!");
else
TextIO.putln("That file is not a directory.");
else {
// List the contents of directory, with no indentation
// at the top level.
listContents( directory, "" );
} // end main()
static void listContents(File dir, String indent) {
// A recursive subroutine that lists the contents of
// the directory dir, including the contents of its
// subdirectories to any level of nesting. It is assumed
// that dir is in fact a directory. The indent parameter
// is a string of blanks that is prepended to each item in
// the listing. It grows in length with each increase in
// the level of directory nesting.
String[] files; // List of names of files in the directory.
TextIO.putln(indent + "Directory \"" + dir.getName() + "\":");
indent += " "; // Increase the indentation for listing the contents.
files = dir.list();
for (int i = 0; i < files.length; i++) {
// If the file is a directory, list its contents
// recursively. Otherwise, just print its name.
File f = new File(dir, files);
if (f.isDirectory())
listContents(f, indent);
else
TextIO.putln(indent + files[i]);
} // end listContents()
} // end class RecursiveDirectoryList
Cheers,
Kosh! -
Hi there,
Is there a way to list all available colors in java?
Thanks
JamesA better question may be how to list all colors available on the output device. I'm not sure how to do that, but the best place to start looking may be java.awt.GraphicsEnvironment.
-
How to retrive all available disk drive ID from windows OS??
I plan to design a "file chooser" by myself because
the one provided by JDK1.3 has a serious bug:
when the signed applet open a file chosser, the program will crash.
I want to list all available disk drive ID.
Does anyone know how to do this??
ThanksMy guess is that you will have to implement a native call. Check out the Windows function GetLogicalDrives()
-
How to list all the rows from the table VBAK
Friends ,
How to list all the rows from the table VBAK.select query and the output list is appreciated.Hi,
IF you want to select all the rows for VBAK-
Write-
Data:itab type table of VBAK,
wa like line of itab.
SELECT * FROM VBAK into table itab.
Itab is the internal table with type VBAK.
Loop at itab into wa.
Write: wa-field1,
endloop. -
Urgent: How to list all alias for a server throw DNS query?
Hi
Is there anyone know how to list all alias for a server by asking the network DNS. Is that possible?
It doesn't work with InetAddress it return a single result.
Best regardInetAddress will not get you the aliases, but you can certainly find all the different IP addresses for a specific host name using the getAllByName() method.
You won't be able to get the aliases since those IP addresses (assuming there are more than 1) will all be cached as mapping to the name you passed to the getAllByName() method and you can't clear the map cache until the JVM exits.
So your best hope is to get a list of IP's and either exit your app and restart with a new mode, or save them to a file for another app to read. -
Sunone Messaging Server 6.1--How to list all mail user's last login time
hi,i want to know how to list all the mail user's last login time.
There are more than 100000 mailbox accounts on our mail server,
i want to know which account is not used for more than 2 or 3 years.
thanks.http://wikis.sun.com/display/CommSuite/imsconnutil
Somchai. -
How can I list all available variables inside a movieClip
I have a lot of movieclips in my file and each movieclip has
its own set of variables.
There is any way to trace all available variables inside any
movieclip? I mean, how can i know what variables and their values
are inside a movie clip!
Tks,if your movieclip has instance name mm, you can use:
-
How to load all the classes in a JAR file at runtime?
Any clues o:
"How can I force JVM to load all the classes in a specified JAR at once?"
Thanx!
-RajeevWell I was thinking may be there exists an option with "java", when I
am starting an application from a jar file, I could force it to load all
the classes in the JAR. I don't want to do it programically. Is there such
an option available?? Or in other words can I ask JVM to not do the dynamic
loading for the JAR??
Thanx.
List all JarEntries and convert the paths to fully
qualified class files
e.g file in jar
[1] /com/mycompany/proj/X.class
should become
[2] com.mycompany.proj.X
then for each entry issue
Class.forName( [2] ); -
How to list all filename in excuteable jar file?
Hi there,
i've been googling around for hours, but found no good answer :(
i want listing all file name in my excuteable jar file
Firstly, i use
File f = new File("/sounds");
String[] filenames = f.list();
and use these filenames to load some resouces from url
//ex
URL url = getClass().getResource("/sounds/"+filenames);
No problem occurs when i run it normally
but when I put it in excuteable jar file, NullPointerException appears
i think it's because : "File f = new File("/sounds");" doesn't work in jar file (somehow, i don't know why too)
is there any alternative way to listing all filename in this situation?
thanks in advanceThere are jar handling classes in the standard library under java.util.jar. I think JarFile is the one you want.
Hower it's not good practice to list jar contents in order to read resources. It's better to have some kind of resource file in the jar which lists your sounds or whatever. A simple text file with one file name per line suffices.
Maybe you are looking for
-
I'm using MacBook Pro 13-inch, early 2011 running 10.7.1. I want to upgrade to 10.7.4 but the system discarded the upgrade after I successfully downloaded it. Please help!
-
WLC 5508 - Throughput/Forwarding Rate
Hi, Anyone know what is the throughput of a 5508 Controller? As it supports Ether-channel and a 8 gig Ether-channel can be configured, therefore it means, the controller has the capacity to foward 8 Gig of traffic. Wondering if anyone has any referen
-
How to manage concurrency of a class
how to manage concurrency of a class???????????
-
TS1702 Why I can't buy the diamond in a game by using ITunes?
Now I'm playing a game that name call tower of saviors. And now my problem is I can't success to buy the diamond in the game! Than i get a massage form the game.it said need to contact you. So how to decide this problem?
-
LP8 with Leopard 10.5.1 - Stability of LP8
I am wondering about the number of crashes i had since i work with the new LP8. I have a Mac Pro with Leopard brand new installed and just while adjusting the key commands i got the first crashes but especially when working with the pitch-machine in