Results 1 to 9 of 9

Thread: Running C++,Assembly,Lisp inline???

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Running C++,Assembly,Lisp inline???

    Code:
     Does anyone know what other 
    languages Java supports to run inline? 
    
    I know you can do somthing
    like this to run a native method
    
      public class Native{
        /* the static initializer ensures that the native library 
           will be loaded before the methood is called
       */
        
         static{
            System.loadLibrary(NativeLibrarylib);
        }
         
       public void nativeMethod(); //native method protype
      }

  2. #2

  3. #3
    Only C/C++. And you should avoid it, because it destroys the crossplatformness of Java.

  4. #4

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    In what way? If you are calling a native method and you have the library included then i dont think you would run into problems with cross platform issues. Or if you running Assembly in line you shouldnt have probles either, as far a i can see.

  5. #5
    Uh, C++ compiled is not cross-platform, and some functions in C and C++ are not cross-platform.

  6. #6

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    So then what would be the point of Sun enabling developers to be able to use native code if it breaks suns so called "implematation" of pure Java and thus creating cross platform issues?

  7. #7
    I used it last year at work to connect to a UNIX daemon process, something Java can't do. It is hard to do and Sun seems to discourage it, but why get rid of a feature?

  8. #8

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    This is true. Just because Java is capable of running on multi platforms does not mean that you are always going to create an app to run on numerous platforms. It might me an "in house" application. So your right.... why get rid of the feature.

  9. #9
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    same thing with part of the System class, it lets you do platform dependand things aswell as independant
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width