Giter Site home page Giter Site logo

thebluematt / cppjvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikehearn/cppjvm

0.0 3.0 0.0 11.96 MB

C++/JVM - making it really easy to call Java from C++

Home Page: http://www.earwicker.com/cppjvm

Shell 0.15% Java 10.54% C++ 15.98% C 73.33%

cppjvm's Introduction

C++/JVM (a.k.a cppjvm)
----------------------

Copyright (C) 2011 Daniel Earwicker <[email protected]>


Inspired by the lacklustre response to this question:

  http://stackoverflow.com/questions/7537822/

Also inspired by C++/CLI (hence the name). You can include Java classes
in your C++ program:

   #include <java/util/regex/Pattern.hpp>
   #include <java/util/regex/Matcher.hpp>
   #include <java/lang/CharSequence.hpp>

You can import the corresponding namespaces:

    using namespace java::lang;
    using namespace java::util::regex;

You can call methods of those classes in your C++ code, exactly as 
you'd expect:

    Pattern pattern = Pattern::compile("\\{[a-z]*\\}");

    Matcher matcher = pattern.matcher(
      String("Some of the {words} in this {sentence} are {special}"));

    while (matcher.find())
      std::cout << matcher.group().str() << std::endl;

To get started, make sure you have a JDK installed, and you've added the
JDK and JRE bin directories to your PATH environment variable. You must
also set JAVA_HOME to point to the JDK directory itself.

On Windows you'll need Cygwin installed, as GNU make is used.

Once you have these prerequisites, just run make to build everything.
If it's successful, you'll see a "Perfect :)" message when the tests
run.



PUBLIC LICENSE

Copyright (C) 2011 Daniel Earwicker <[email protected]>

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it in any way you wish, as long as you do not
attribute the modifications to the original author.



cppjvm's People

Contributors

danielearwicker avatar mikehearn avatar thebluematt avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.