Loading a class not on classpath

how can we load a class not on classpath?

uddinr0121 wrote:
try this
private void addArchive(File jarFile) throws IOException {
URL u = jarFile.toURI().toURL();
URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();
Class<?> sysclass = URLClassLoader.class;
try {
Method method = sysclass.getDeclaredMethod("addURL", parameters);
method.setAccessible(true);
method.invoke(sysloader, new Object[]{u});
} catch (Throwable t) {
t.printStackTrace();
}this will add the jar file to the classpath after which you should be able to invoke using Class.forName()
hope this helpsThat's a horrible solution, when you can just create a new URLClassLoader and use that to load the class.
Adding it to the system classpath with reflection trickery is not really a clean solution to that.

Similar Messages

  • Loading a class dynamically to classpath

    I have a class object for my .class file. It thougth it would be loaded to the classpath dynamcially by resolveClass(Class c), but still i am not able to add my class to the VM's classpath.
    Can anybody help,
    Thanks in advance
    Amir

    how do you get that Class object?
    If you use Class.forName(java.lang.String), the class loads itself, if found in classpath.
    If the class is dynamicaly generated, and you have the the file, or the bytes that form the class, you may invoke
    ClassLoader.defineClass(String name, byte[] b, int off, int len)
    I have no idea if my answer is anywhere near what you expect...

  • Loading a class from specified classpath

    Hello,
    I would like to create an instance of a class in a specific directory.
    So, I am doing this way :
    System.setProperty("java.class.path", classPath.getAbsolutePath());
    Class object = Class.forName(name);
    Object instance = object.newInstance();It works perfectly when running in my IDE (Eclipse).
    But when I am running my application through a JAR, I encountered the following error :
    ClassNotfoundException
    I don't understand why an exception is thrown whereas I defined correctly my classpath.
    Could you help me ?

    When running from an executable jar the normal class path is ignore in favour of thejar and any Class-Path specified in the jar's manifest.
    What you want is a URLClassLoader. Bascially:
    URLClassLoader cl = new URLClassLoader(new URL[]{classPath.toURL()});
    Class clazz = cl.loadClass(fullName);(Catch assorted exceptions)
    There should not be a class of the given name in the jar, or libraries it references (if there is, that will be loaded in preference).

  • WEB-INF/classes not in classpath issue - bug or specification?

    I've noticed BC4J expects some of its configuration files to be present in the standard classpath or the application.
    However, when running web-apps, the WEB-INF/classes are used for loading classes by the JVM, but they are not in the classpath literaly which causes BC4J not to find its metadata files - this has caused many people to be confused because they believed (like me) that the /classes folder is just another part of the classpath.
    But someone has to solve this! After all, if I have a million web-apps, I (as a BC4J user) do not want to include a million JAR files in the classpath. I want to put the JAR in the classes directory and have BC4J find it automatically since its part of the web-app's classes, jars/zips and such.
    The question is, is this a BC4J issue (not finding the files) or a Java Specification issue? and if this is a mere BC4J issue, why won't Oracle provide a small patch for BC4J (simply release an updated JAR/ZIP file)? Or instead, put it in BC4J release notes (unless its already there and I've missed it..) so that customers won't have to spend/waste valuable time trying to understand.
    Regards to all,
    Arik Kfir.

    Originally posted by Arik Kfir ([email protected]):
    I've noticed BC4J expects some of its configuration files to be present in the standard classpath or the application.
    However, when running web-apps, the WEB-INF/classes are used for loading classes by the JVM, but they are not in the classpath literaly which causes BC4J not to find its metadata files - this has caused many people to be confused because they believed (like me) that the /classes folder is just another part of the classpath.
    But someone has to solve this! After all, if I have a million web-apps, I (as a BC4J user) do not want to include a million JAR files in the classpath. I want to put the JAR in the classes directory and have BC4J find it automatically since its part of the web-app's classes, jars/zips and such.
    ===========================================
    If I understand you correctly, it sounds like you need to put the bc4j .jar files in the /j2ee/home/lib directory...by placing a jar file there, it becomes available to all web applications running inside OC4J...
    does that solve your problem?
    regards,
    Mike Conway
    UNC Chapel Hill

  • Loading all classes on classpath

    Hello!
    I'm trying to create some kind of "Package browser" which I can use for selecting a class that exists on the classpath.
    I've come up with a solution that reads the classpath property and then looks up the classes by searching each directory and jar-file for class files. These are presented in a JTree. This solution has a drawback though. When using Visual Age for Java, my app won't find any class files on the classpath as these are not added to the local file system. It seems Visual Age has it's own ClassLoader which loads classes from it's own repository rather than from the file system.
    Now I wonder, is there another way to load all classes from the classpath?
    Regards,
    Pelle Poluha

    Visual Age uses the "system" classpath alright. When I add another directory to the classpath using VA, my "package browser" recognizes this but shows an empty directory. And it is empty on my local file system. What I can do is to export all the classes I need to a directory or jar-file and then add this to the classpath. Then my app recognizes the classes. But this is too cumbersome.
    What I need, I guess, is a way of communicating with the current classloader and get it to return all classes/packages in a given package. Anybody knows if that's possible?
    Regards,
    Pelle Poluha

  • JVM cannot be loaded  - Class not registered

    I am using Windows XP Home.
    While trying to open an application I get the following error message :
    Unable to start the application -- the Java Virtual Machine cannot be loaded.
    Class not registered.
    I was using the J2SE RE 5.0 Update 4 which took around 118 MB of disk space.
    After going through certain similar cases on the forum I uninstalled the same and downloaded a smaller 5 MB file but that said it isnt s WIN32 application. So I again downloaded the J2SE RE 5.0 UPDATE 4.
    And the problem still persists. I am not very familiar with Java applications and codes. Please help me with this.
    Also this application is working fine on my colleague's machine. His Internet Options - > Advanced Tab -> has an item called Java Virtual Machine whereas mine doesn't. How can I resolve this.

    Internet Explorer can use the old and now obselete Microsoft Virtual Machine, or the latest Sun Java virtual machine.
    Your friend must have the old microsoft virtual machine installed.
    I think you only need to plug the Sun VM into Internet Explorer... simple enough.
    Go to the Control Panel of Windows.
    There should be an icon/entry for "Java(TM) Control Panel".... open it.
    Go to the "Advanced" tab.
    Select the "<APPLET" tag support.
    Enable "Internet Explorer"....
    Click on the "Apply" button, then click "Ok"...
    And retry.
    Assumptions:
    I assumed you have installed / reinstalled Java 5.0 correctly, and have administrator security priviledges to your own machine.
    regards,
    Owen

  • Class not found error!!!

    Hello,
    I wrote a program that would read data from a file (present in one of my folders). I developed it as an applet and am able to see the result in appletviewer, but unable to see it in the browser(IE6-WIN2000). I did the HTMLConverter procedure and saw that it worked for all other files except this. The error it gives is:
    load: rdbyte class not found
    However, this class file is located in the same folder. And all the necessary methods like init() etc are present in my program.
    Please help me!!!
    Thanks
    NS

    Do you have used any other package then default package?
    Look at the documentation and search something like this:
    <applet>
    <param name="code" value="yourClass.class">
    <param name="codebase" value="classFileDirectory">
    </applet>
    Your applet must be signed to read or write file from your filesystem.

  • Could not find or load main class weblogic.WLST

    Hi,
    I am trying to run a python script to create JMS components for use with iHub and i got the following error message when i try to run the script:
    C:\ihub\bin>java weblogic.WLST omipmihubwlscript.py weblogicjms Welcome1 http://<servername>:7111 OMIPMIHUBServer
    Error: Could not find or load main class weblogic.WLST
    I have run the setWLSEnv.cmd file and got the following output
    C:\oracle\Middleware2\wlserver_10.3\server\bin>setWLSEnv.cmd
    CLASSPATH="C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\sys_manifest_classpath\weblogic_p
    atch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~2\mod
    ules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~2\modu
    les\NETSFA~1.0_1/lib/ant-contrib.jar;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\sys_man
    ifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic.
    jar;C:\oracle\MIDDLE~2\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1/lib/ant-all.j
    ar;C:\oracle\MIDDLE~2\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp37
    1\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSER
    V~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~2\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\module
    s\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~2\modules\NETSFA~1.0_1/lib/ant-contrib.jar;"
    PATH="C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDD
    LE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\oracle\MIDDLE~2\patch_wls1036\profiles\defa
    ult\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDDLE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\module
    s\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\
    default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDDLE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bi
    n;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\app\paul.currie\product\11.2.0\client_2\bin;C:\app\paul.currie\product\11.2.0\dbhome_3\bin;C:\Program Files (x86)\PC Connectivity Solution\;C:\Wind
    ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_13\jre\bin;;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x
    64\oci920_8;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64\oci920_8;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64\oci920_8"
    Your environment has been set.
    I am totally stuck at this point so any help would be much appreciated.
    Cheers
    Paul

    I have just tested both on a Windows and a Linux server and it works fine.
    D:\oracle\product\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd
    CLASSPATH=D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\oracle\
    product\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\oracle\product\JAVA_C~1\li
    b\tools.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\serve
    r\lib\weblogic.jar;D:\oracle\product\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;D:\oracle\product\MI
    DDLE~1\WLSERV~1.3\server\lib\webservices.jar;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;D:\oracle\pro
    duct\MIDDLE~1\modules\NETSFA~2.0_1/lib/ant-contrib.jar;D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\sys_man
    ifest_classpath\weblogic_patch.jar;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\web
    logic_patch.jar;D:\oracle\product\JAVA_C~1\lib\tools.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.ja
    r;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;D:\oracle\product\MIDDLE~1\modules\features\weblogic.ser
    ver.modules_10.3.5.0.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;D:\oracle\product\MIDDLE~1\mod
    ules\ORGAPA~1.1/lib/ant-all.jar;D:\oracle\product\MIDDLE~1\modules\NETSFA~2.0_1/lib/ant-contrib.jar;
    PATH=D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\native;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles
    \default\native;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server
    \bin;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1\bin;D:\oracle\product\JAVA_C~1\jre\bin;D:\oracle\product\JAVA_C~1\bin
    ;D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\native;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles\def
    ault\native;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\bin
    ;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1\bin;D:\oracle\product\JAVA_C~1\jre\bin;D:\oracle\product\JAVA_C~1\bin;C:\
    Program Files\Legato\nsr\bin;C:\PROGRA~2\CA\SHARED~1\ETPKI\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C
    :\Windows\System32\WindowsPowerShell\v1.0\;D:\oracle\Java\current\jre\bin;C:\PROGRA~2\CA\IDENTI~1\PROVIS~1\BIN;C:\Progra
    m Files (x86)\CA\SharedComponents\CAM\bin;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8;D:\oracle
    \product\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8
    Your environment has been set.
    D:\oracle\product\Middleware\wlserver_10.3\server\bin>java weblogic.WLST
    Initializing WebLogic Scripting Tool (WLST) ...
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands
    wls:/offline>

  • Class not found error afer loading classes to oracle

    hi i have loaded quite a few jars into oralce 11g databse
    created a java stored function
    and executed it
    some times it works... and hits the java front end environment... we are hitting a servlet.. and recording some output statements .. in the function
    but sometimes it throws class not found error
    any idea why its working sometimes and not some othr times?
    Also when i load the jars.. the classes are loaded but when i see the name of the classes using
    select * from user_objects where object_type like 'J%'
    then i see some additional characters prefixxed the class names ... is that causing the problem?
    something like this
    /1a248e6f_GetMethod
    Edited by: learning_man on Mar 11, 2010 1:27 PM

    Learning_man,
    Obviously you need to learn how to ask a question.
    There is nothing in your post other than 'It doesn't work. Why? Help"
    without any specific example. Also you still fail to include a 4 digit version!!!
    It is also the third or the fourth time you asked this very same question.
    Can you learn how to ask a question please? And stop repeating the question when you don't get a response?
    And no, the extra characters are not the problem.
    An incorrect CLASSPATH probably is.
    Sybrand Bakker
    Senior Oracle DBA

  • ADS: com.adobe.ProcessingException: Class not found exception while loading

    Hi All,
    While i'm trying to activate FORM (Interactive Form in Transaction SFP), i'm getting error -
    ADS: com.adobe.ProcessingException: Class not found exception while loading class SAPForm, classpath: /usr/sap/AHS/DVEBMGS00/exe/jstart7 1.jar/usr/sap/AHS/DVEBMGS00/exe.
    Could anyone let me know the way to resolve this issue.
    Thanks and Regards,
    Sunil

    Many Thanks for the reply-It's working now
    I added the MySQL connector in the following manner
    1)Open the Tom Cat server console by Selecting 'Servers' in Package Explorer
    2)Right Click 'Tomcat v5.5 at localhost.server'
    3)Select 'Open Launch Configuration' under 'General Information'
    4)Select the 'Classpath' tab in the Edit configuration window that opens
    5)Select 'Add External Jars' and add the required connector

  • Class could not be loaded or is not an entity class

    Hello,
    I am using Berkeley DB JE 3.3.75 in a web application. I have a class which extends a Persistent class.
    @Entity
    public class XMessageInMemoryAdapter extends XMessage implements Serializable {
    private static final long serialVersionUID = 1L;
    @SecondaryKey(relate=Relationship.MANY_TO_ONE)
    private int objectStatus;
    @Persistent
    public class XMessage extends YMessage implements Serializable {
    private static final long serialVersionUID = 1L;
    @SecondaryKey(relate=Relationship.MANY_TO_ONE)
    private String serviceVariant;
    @Persistent
    public abstract class YMessage implements Serializable {
    private static final long serialVersionUID = 42L;
    @PrimaryKey
    private String messageGroupId;
    But when I try to query the PrimaryKey, an IllegalArgumentException is thrown:
    java.lang.IllegalArgumentException: Class could not be loaded or is not an entity class: com.mycompany.common.model.XMessageInMemoryAdapter
    at com.sleepycat.persist.impl.Store.checkEntityClass(Store.java:1175)
    at com.sleepycat.persist.impl.Store.getPrimaryIndex(Store.java:313)
    at com.sleepycat.persist.EntityStore.getPrimaryIndex(EntityStore.java:257)
    at com.mycompany.common.memorydb.impl.StoreRefImpl.queryPrimaryIndex(StoreRefImpl.java:49)
    at com.mycompany.common.memorydb.dao.MessageDao.init(MessageDao.java:67)
    And here is the MessageDao ve StoreRefImpl ( I deleted irrelevant parts )
    public class MessageDao {
         protected void init() {
              primaryKey = this.store.queryPrimaryIndex(String.class, XMessageInMemoryAdapter.class);
    public class StoreRefImpl {
         public PK queryPrimaryIndex(Class<?> indexClass, Class<?> objectClass) {
              try {
                   PrimaryIndex index = this.store.getPrimaryIndex(indexClass, objectClass); // this is where the exception is thrown
                   return new PKImpl(index);
              } catch (DatabaseException e) {
                   throw new DBException(e);
    Everything working nice in my local machine but when we deploy the application on test server we keep getting this exception.
    Thank you for your help.

    Hi Yusuf,
    This sounds like a classpath problem on your test server. This exception will occur if the class cannot be loaded.
    Please make sure that the je-3.3.75.jar file and your app classes or jar are in the same classpath location, and that there are not multiple copies in different locations. For example, if you're deploying a servlet, be sure to place the JE jar and your app jar in the same lib directory.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem loading modified classes from CLASSPATH using system class loader

    Hi,
    I am facing problem to load the modified classes from CLASSPATH.
    I have set my CLASSPATH to a directory whose classes will be modified frequently. After the server(web/app) is started, the system class loader, using which am trying to load the classes from the directory where the CLASSPATH is set, am not able to load the modified files without the server restart.
    Do I need to have a custom class loader to fix this.
    Please help me.
    Thanks,
    Sureddy

    Do I need to have a custom class loader to fix this.Yes.

  • Tomcat 4.2 is not loading a class in jar file

    Hi All,
    I have a java class B in a jar file which is in tomcat's lib directory. I am trying to instantiate class B from class A which is in the same jar file. But I am unable to create an instance of class B and the control in the program simply advance to the next line and there is no error printed in tomcat log files.
    Can anyone please tell me what am I missing here ... why class A is getting loaded correctly whereas class B is not loaded by tomcat ?
    Thanks & Regards,
    Kumar.

    Can you sure that there is only a A class in the classpath of Tomcat, I advise you to add
    some statements into the A class so that you can be sure which classloader is used
    to load the A class.

  • [SOLVED] Java could not find or load main class

    I just tried to run a Java program using Swing components from the terminal, but I always get this error message:
    $ java VisualTest
    Error: Could not find or load main class VisualTest
    The strange thing is that it runs flawlessly from within Eclipse.
    I created VisualTest.java using the (old) Visual Editor, it's contents are:
    package visual1;
    import javax.swing.SwingUtilities;
    //import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    public class VisualTest extends JFrame {
    private static final long serialVersionUID = 1L;
    private JPanel jContentPane = null;
    * @param args
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    VisualTest thisClass = new VisualTest();
    thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    thisClass.setVisible(true);
    * This is the default constructor
    public VisualTest() {
    super();
    initialize();
    * This method initializes this
    * @return void
    private void initialize() {
    this.setSize(300, 200);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setContentPane(getJContentPane());
    this.setTitle("JFrame");
    * This method initializes jContentPane
    * @return javax.swing.JPanel
    private JPanel getJContentPane() {
    if (jContentPane == null) {
    jContentPane = new JPanel();
    jContentPane.setLayout(null);
    return jContentPane;
    As you can see, there is a class named VisualTest and it contains a main function.
    My CLASSPATH variable contains a dot, like
    .:/home/mk/.java/deployment/ext/*
    I just updated my Java from JDK 7u67 to JDK 8u20 (the Oracle one, in AUR), but I can't imagine this is related (however, I haven't run Java programs from the terminal for a long time).
    Strangely enough, a simple HelloWorld.java
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    runs flawlessly from within the terminal.
    Last edited by Marcel- (2014-09-26 12:44:35)

    As intended by my institution, I said to Eclipse that it should store sources and class files in the same directory. Let's do ls and test:
    [~/workspace]$ ls
    total 12K
    drwxr-xr-x 4 mk mk 4.0K Sep 23 18:23 visualtest/
    -rw-r--r-- 1 mk mk 426 Sep 24 15:45 HelloWorld.class
    -rw-rw-r-- 1 mk mk 111 Sep 24 15:44 HelloWorld.java
    [~/workspace]$ java HelloWorld
    Hello World!
    vs.
    [~/workspace/visualtest/visual1]$ ls
    total 12K
    -rw-r--r-- 1 mk mk 528 Sep 24 15:38 VisualTest$1.class
    -rw-r--r-- 1 mk mk 1.1K Sep 24 15:38 VisualTest.class
    -rw-r--r-- 1 mk mk 1.2K Sep 24 00:32 VisualTest.java
    [~/workspace/visualtest/visual1]$ java VisualTest
    Error: Could not find or load main class VisualTest
    I also tested this with another project that runs fine in Eclipse, but it gives the same error message when trying to issue `java StemOpPartijFrame`.
    EDIT:
    One difference between the two OSs though is that Linux progresses.  The other decays..
    Two? I count many! And I don't think something like OpenBSD decays. ;-)
    Last edited by Marcel- (2014-09-24 16:54:12)

  • Could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature?

    Hi,
    Am getting below error while performing ESRI shapefile into oracle database table.,
    C:\>java -cp G:\app\product\11.2.0\dbhome_1\jdbc\lib\ojdbc14.jar;G:\app\product\
    11.2.0\dbhome_1\md\jlib\sdoutl-1.0.jar;\G:\app\product\11.2.0\dbhome_1\md\jlib\s
    doapi-1.0.jar oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p
    1521 -sn orcl -u MDSYS -d selva -t shapes -f F:\saptial\Africa.shp -r 8307 -g ge
    ometry
    Error: Could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature
    Am using java version as ,
    C:\>java -version
    java version "1.7.0_51"
    Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
    Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
    And also tried in MapBuilder its working fine.,but i need to import using java utility can any help me too this.,

    i had tried below this way and problem got solved .,
    Before i have downloaded
    sdoutl-11.2.0.jar and sdoapi-11.2.0.jar used it for import shp file ..
    C:\>set ORACLE_HOME=G:\app\product\11.2.0\dbhome_1
    C:\Users\SELVA>cd downloads
    C:\Users\SELVA\Downloads>cd statplanet_zambia
    C:\Users\SELVA\Downloads\StatPlanet_Zambia>cd map
    located into particular path and set my oracle home
    C:\Users\SELVA\Downloads\StatPlanet_Zambia\map>set ORACLE_HOME=G:\app\product\11.2.0\dbhome_1
    C:\Users\SELVA\Downloads\StatPlanet_Zambia\map>java -classpath %ORACLE_HOME%\jdb
    c\lib\ojdbc5.jar;%ORACLE_HOME%\md\jlib\sdoutl-11.2.0.jar;%ORACLE_HOME%\md\jlib\sdoapi-11.2.0.jar oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p 1521 -s orcl -u MDSYS -d selva -t zambia -f map -r 8307 -g geometry
    host: localhost
    port: 1521
    sid: orcl
    db_username: MDSYS
    db_password: selva
    db_tablename: zambia
    shapefile_name: map
    SRID: 8307
    db_geometry_column: geometry
    Connecting to Oracle10g using...
    localhost, 1521, orcl, MDSYS, selva, zambia, map, null, 8307
    Dropping old table...
    java.sql.SQLException: ORA-00942: table or view does not exist
    Creating new table...
    9 record(s) converted.
    Done.
    Thanks
    Selva

Maybe you are looking for

  • Error in  deploying the visual composer model

    Hello friends,     I have issue in deploying model in Visual Composer.I am able to compile the model successfully. While deploying the model I am getting following error: Error in compiling Flex application: java.lang.InternalError: Can't connect to

  • Scheduling report in background and passing the necessary parameters

    Hi all, Using code (in a report1) ...i want to execute a report (report2) in background.....but at the same time i want to pass data (an internal table and a variable) to that report2. is it possible to pass data like internal table to a executable r

  • Fedreted Portal not working

    Hi All, I have a question related to the Federated Portal Network. We have configured FPN between two portals : 1. Portal for BI (Producer Portal) (EP 7.0) 2. Portal for other systems (Consumer Portal) (EP 7.0) After doing all the settings what we co

  • How to migrate the images

    Hi, I need to migrate an Apex application from 10.2 to 11. The steps I have taken: The apex version is same: 3.1. I use an OAS instead apex embedded http server. 1, configure dads.conf 2, copy images files to the default location, 3, export and impor

  • ResultSet size

    Hi all, Is there any simple way to get the number of rows in a ResultSet object before iterating it? Right now I have to iterate it the ResultSet object first and then I can determine the rows.... Is there any faster method? Thanks.