473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C++ implementation of core Java API

Apologies if someone finds this OT

I am looking for an open-source C++ implementation of Java API ----
something that does not require a Java run-time environment. So far
the only thing that I have found is NewJ from pure-native.com. It
looks good, but it is not open source. Can anyone provide some
pointers?

Zhang

Nov 1 '07 #1
27 3883
Generic Usenet Account wrote:
Apologies if someone finds this OT

I am looking for an open-source C++ implementation of Java API ----
something that does not require a Java run-time environment ...
Zhang;

Sourceforge.net has a number of C++ implementations. Try the site's
"advanced search."

hth,
-Craig

A couple of hits that may interest you ...

<https://sourceforge.net/projects/j2k/>
"A completely portable C++ library, to provide a standard set of classes
similar to Java Common API. It's highly efficient and it follows the
Embedded C++ Standard. It's FREE (LGPL licensed)."

<https://sourceforge.net/projects/stemkit/>
"A set of C++ libraries and build tools that provide core classes to
build a project upon. From exceptions and basic types (String, Integer,
Float, etc.) to collections and tracers. Where possible, Java API is
followed. Implementation is based on STL."
Nov 1 '07 #2
Craig wrote:
<https://sourceforge.net/projects/j2k/>
"A completely portable C++ library, to provide a standard set of classes
similar to Java Common API. It's highly efficient and it follows the
Embedded C++ Standard. It's FREE (LGPL licensed)."

<https://sourceforge.net/projects/stemkit/>
"A set of C++ libraries and build tools that provide core classes to
build a project upon. From exceptions and basic types (String, Integer,
Float, etc.) to collections and tracers. Where possible, Java API is
followed. Implementation is based on STL."
Whoa. Cool!
Nov 2 '07 #3
Mark Space wrote:
Craig wrote:
><https://sourceforge.net/projects/j2k/>

<https://sourceforge.net/projects/stemkit/>

Whoa. Cool!

Lemmee guess: That's a good thing, right?

<grin>
-Craig
Nov 2 '07 #4
On Thu, 01 Nov 2007 20:54:15 -0800, Craig wrote:
Mark Space wrote:
Craig wrote:
<https://sourceforge.net/projects/j2k/>

<https://sourceforge.net/projects/stemkit/>
Whoa. Cool!

Lemmee guess: That's a good thing, right?

<grin>
-Craig
Be glad he didn't say "Cool beans".

Geektalkwarer
Nov 2 '07 #5
Mark Space wrote:
Craig wrote:
><https://sourceforge.net/projects/j2k/>
"A completely portable C++ library, to provide a standard set of
classes similar to Java Common API. It's highly efficient and it
follows the Embedded C++ Standard. It's FREE (LGPL licensed)."

<https://sourceforge.net/projects/stemkit/>
"A set of C++ libraries and build tools that provide core classes to
build a project upon. From exceptions and basic types (String,
Integer, Float, etc.) to collections and tracers. Where possible, Java
API is followed. Implementation is based on STL."

Whoa. Cool!
stemkit looks like an empty project to me.

--
Paul M. Dubuc
Nov 2 '07 #6
Lew
Paul M. Dubuc wrote:
stemkit looks like an empty project to me.
It also has a name suspiciously similar to "rootkit".

--
Lew
Nov 2 '07 #7
Krazee Brenda wrote:
On Thu, 01 Nov 2007 20:54:15 -0800, Craig wrote:
>Mark Space wrote:
>>Craig wrote:

<https://sourceforge.net/projects/j2k/>

<https://sourceforge.net/projects/stemkit/>
Whoa. Cool!
Lemmee guess: That's a good thing, right?

<grin>
-Craig

Be glad he didn't say "Cool beans".

Definitely a good thing, since both projects look like abandon-ware, and
are very incomplete. Too bad, even a partial implementation could have
been useful.

But if they had been useful, I would have said "cool beans." ;-)
Nov 2 '07 #8
Mark Space wrote:
Krazee Brenda wrote:
>On Thu, 01 Nov 2007 20:54:15 -0800, Craig wrote:
>>Mark Space wrote:
Craig wrote:

<https://sourceforge.net/projects/j2k/>
>
<https://sourceforge.net/projects/stemkit/>
Whoa. Cool!
Lemmee guess: That's a good thing, right?

<grin>
-Craig

Be glad he didn't say "Cool beans".


Definitely a good thing, since both projects look like abandon-ware, and
are very incomplete. Too bad, even a partial implementation could have
been useful.

But if they had been useful, I would have said "cool beans." ;-)
<meh Sorry 'bout that. You might want to try the "advanced" search on
Sourceforge. The string below sorts (+java +api +"c++") by activity.
Looks more promising than the last.

hth,
-Craig

<http://sourceforge.net/search/index.php?words=%28%2Bjava+%2Bapi+%2B%22c%2B%2B%22 %29&sort=percentile&sortdir=desc&offset=0&type_of_ search=soft&pmode=0&form_cat=18>
Nov 2 '07 #9
On Fri, 02 Nov 2007 19:18:01 GMT, Mark Space wrote:
>Definitely a good thing, since both projects look like abandon-ware, and
are very incomplete. Too bad, even a partial implementation could have
been useful. But if they had been useful, I would have said "cool beans." ;-)
It's not so simple to 'port' the core Java API to C++ as it seams at
first sight. Java e.g. uses references to objects. The 'copy' of a
container doesn't copy objects, only references. In C++ you probably
would disable copying of the container but then your container differs
from a Java container. Moreover, the developement of a production
quality library of that size is quite difficult and time-consuming.

More (mostly abandoned) Java-like libraries:
http://acdk.sourceforge.net/acdk/docs/hb/acdk_hb.html
http://bluelib.sourceforge.net/
http://www.jakelib.org/lib/jakelib2/index.html
http://www.pure-native.com/newj/faq.html
http://www.decompile.com/not_invente...alib/index.htm
http://www.mike95.com/c%5Fplusplus/
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Nov 2 '07 #10
On Fri, 02 Nov 2007 22:00:00 GMT, Roland Pibinger wrote:
It's not so simple to 'port' the core Java API to C++ as it seams at
first sight. Java e.g. uses references to objects. The 'copy' of a
container doesn't copy objects, only references. In C++ you probably
would disable copying of the container but then your container differs
from a Java container. Moreover, the developement of a production
quality library of that size is quite difficult and time-consuming.
McCoyHatfieldware
Nov 3 '07 #11
On Nov 2, 11:00 pm, rpbg...@yahoo.com (Roland Pibinger) wrote:
On Fri, 02 Nov 2007 19:18:01 GMT, Mark Space wrote:
Definitely a good thing, since both projects look like
abandon-ware, and are very incomplete. Too bad, even a
partial implementation could have been useful. But if they
had been useful, I would have said "cool beans." ;-)
It's not so simple to 'port' the core Java API to C++ as it
seams at first sight.
It depends on what you mean by "port". Just mimicing the
Java API exactly, mapping what Java calls references to C++
pointers, is really a problem, but it is stupid, even if you're
using garbage collection. The languages are different, and are
(or should be) used differently.
Java e.g. uses references to objects. The 'copy' of a
container doesn't copy objects, only references.
Do Java containers support copy? Java doesn't have copy
constructors. Java doesn't need or want copy constructors,
because Java uses reference semantics, not value semantics.

You can do this in C++ too, but it's stupid. It doesn't really
fit into the language. (And again, this is true even if you use
garbage collection.) What you want to do is to "adapt" the Java
API to C++, taking what's good in it, and adapting it to the C++
idiom. (For example, considered globally, Swing isn't bad at
all---it seems significantly better than the C++ GUI libraries
I've looked at. And adapting Swing to the C++ idiom could even
fix some of the minor flaws it has, e.g. by returning Dimension
as a value, rather than as a reference.)

For other things, you might not want to adopt Java directly.
The Java collections may be better than the C++ containers
(which a probably about the worst I've seen, from a design point
of view), but they still are far from known best practice.
There are libraries available (e.g. OSE) which are better than
both.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Nov 3 '07 #12
On Sat, 03 Nov 2007 10:07:00 -0000, James Kanze wrote:
>It's not so simple to 'port' the core Java API to C++ as it
seams at first sight.

It depends on what you mean by "port". Just mimicing the
Java API exactly, mapping what Java calls references to C++
pointers, is really a problem, but it is stupid, even if you're
using garbage collection. The languages are different, and are
(or should be) used differently.
IMO, it's possible to 'transfer' the core Java API to C++ if you
explicitly address the differences between the two languages in your
design. Besides better usability the advantage would be that nowadays
more people know the Java API compared to those who know the C++ std
library (even among C++ programmers ;-)
>Java e.g. uses references to objects. The 'copy' of a
container doesn't copy objects, only references.

Do Java containers support copy? Java doesn't have copy
constructors. Java doesn't need or want copy constructors,
Right, nobody needs them in Java (although Java has copy constructors
and the clone function) and nobody needs them in C++. In Java, C++ and
other languages objects in the OOP sense are non-copyable, at least
conceptually. But in C++ you cannot e.g. just return a shallow copy of
a container of pointers from a function as you would do in Java.
>because Java uses reference semantics, not value semantics.
>You can do this in C++ too, but it's stupid. It doesn't really
fit into the language. (And again, this is true even if you use
garbage collection.) What you want to do is to "adapt" the Java
API to C++, taking what's good in it, and adapting it to the C++
idiom.
That's the point. Adapt the Java API to C++ idioms. You can do the
same in C++ with pointers what you can do with references in Java. As
long as you don't try to copy the container the differences are minor.
Of course, in C++ you always have to take ownership into
consideration.
>(For example, considered globally, Swing isn't bad at
all---it seems significantly better than the C++ GUI libraries
I've looked at. And adapting Swing to the C++ idiom could even
fix some of the minor flaws it has, e.g. by returning Dimension
as a value, rather than as a reference.)
I wouldn't consider Swing a 'core' Java API (and many GUI experts
wouldn't agree with your assessment of Swing).
>For other things, you might not want to adopt Java directly.
The Java collections may be better than the C++ containers
(which a probably about the worst I've seen, from a design point
of view),
STL was meant as a proof of concept. It would have needed some
iterations in the real world to become more user-friendly. The current
'value only' approach in STL is unnecessary limiting but its
functional programming concepts are more fashionable today than they
were in 1995.
>but they still are far from known best practice.
There are libraries available (e.g. OSE) which are better than
both.
Maybe, but familiarity is the 'selling proposition' for the Java API.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Nov 3 '07 #13
Lew
Krazee Brenda wrote:
McCoyHatfieldware
???

--
Lew
Nov 3 '07 #14
Lew
James Kanze wrote:
>garbage collection.) What you want to do is to "adapt" the Java
API to C++, taking what's good in it, and adapting it to the C++
idiom.
Roland Pibinger wrote:
That's the point. Adapt the Java API to C++ idioms. You can do the
same in C++ with pointers what you can do with references in Java. As
long as you don't try to copy the container the differences are minor.
Of course, in C++ you always have to take ownership into
consideration.
Some years back I worked on a multi-threaded C++ app. I wrote C++ versions of
Java's Thread and Runnable classes for it, based on a freely-available
pthreads library.

It turned out that it was tricky to get the semantics to match, in part
because a C++ reference (type&) is not the same as a Java reference. Also
tricky was to get Thread to be startable on its own or with a Runnable argument.

It turned out to be very useful to have a C++ equivalent to these classes. It
sure was simpler to use them than the raw pthreads lib.

There can be a distinct value to having Java-like libraries in C++. More
power to those who develop such libs; it ain't easy.

--
Lew
Nov 3 '07 #15
On Sat, 03 Nov 2007 10:21:04 -0400, Lew wrote:
Some years back I worked on a multi-threaded C++ app. I wrote C++
versions of
Java's Thread and Runnable classes for it, based on a freely-available
pthreads library.

It turned out that it was tricky to get the semantics to match, in part
because a C++ reference (type&) is not the same as a Java reference.
Also
tricky was to get Thread to be startable on its own or with a Runnable
argument.
McCoyHatfieldware
Nov 4 '07 #16
Lew
Krazee Brenda wrote:
McCoyHatfieldware
What are you on about?

--
Lew
Nov 4 '07 #17
On Sat, 03 Nov 2007 22:30:20 -0400, Lew wrote:
Krazee Brenda wrote:
McCoyHatfieldware

What are you on about?

--
Lew
Ganjaware
Nov 4 '07 #18
Lew
Krazee Brenda wrote:
On Sat, 03 Nov 2007 22:30:20 -0400, Lew wrote:
>Krazee Brenda wrote:
>>McCoyHatfieldware
What are you on about?

--
Lew

Ganjaware
Plonk.

--
Lew
Nov 4 '07 #19
On Sat, 03 Nov 2007 10:21:04 -0400, Lew <le*@lewscanon.comwrote:
>Some years back I worked on a multi-threaded C++ app. I wrote C++ versions of
Java's Thread and Runnable classes for it, based on a freely-available
pthreads library.
It turned out that it was tricky to get the semantics to match, in part
because a C++ reference (type&) is not the same as a Java reference.
A Java reference is largely the same as a C/C++ pointer whereas C++
references are 'real' references.
>There can be a distinct value to having Java-like libraries in C++.
I agree with that. There isn't much activity in this regard any more,
though (and in C++ in general), see e.g.
http://doc.trolltech.com/qq/qq12-qt4-iterators.html
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Nov 4 '07 #20
Lew
Roland Pibinger wrote:
A Java reference is largely the same as a C/C++ pointer whereas C++
references are 'real' references.
Nice pat description, but not accurate in detail. There are significant
differences in the semantics of Java references compared to C++ pointers or to
C++ references. That's the lesson I took away from implementing Java's Thread
and Runnable semantics in C++, and from other experience. In fact, thinking
of Java references as "the same", largely or otherwise, as either of the
others will lead to trouble in the code.

--
Lew
Nov 4 '07 #21
Krazee Brenda - 04.11.2007 08:19 :
On Sat, 03 Nov 2007 22:30:20 -0400, Lew wrote:
>Krazee Brenda wrote:
>>McCoyHatfieldware
What are you on about?

--
Lew

Ganjaware
KB, your endless "...ware"-contributions are very
readworthy, impressive and remarkable. So your monthly upper
statistic-ranking of your (re)postings is not wondering.

BTW: And please do not quote the right delimited (-- ) sig again. THX.

--

by(e) PS

spam will be killfiled

Nov 4 '07 #22
On Nov 4, 2:57 pm, Lew <l...@lewscanon.comwrote:
Roland Pibinger wrote:
A Java reference is largely the same as a C/C++ pointer
whereas C++ references are 'real' references.
Nice pat description, but not accurate in detail. There are
significant differences in the semantics of Java references
compared to C++ pointers or to C++ references.
Such as? C++ pointers do have additional features: they are
first class objects, for example and they support pointer
arithmetic. But since we're talking about emulating Java in
C++, and not the reverse, you can just ignore the added
features.
That's the lesson I took away from implementing Java's Thread
and Runnable semantics in C++, and from other experience. In
fact, thinking of Java references as "the same", largely or
otherwise, as either of the others will lead to trouble in the
code.
Trying to treat pointers as first class objects in Java will
lead to problems in Java, yes. If you're considering mapping in
the two directions, then you do have very distinctive concepts.
But if you're looking for the functionality of Java references
in C++, pointers have everything that is needed. (Of course,
you'll probably want to install garbage collection. But you'll
probably want to do that anyway.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Nov 4 '07 #23
On Nov 3, 3:21 pm, Lew <l...@lewscanon.comwrote:
James Kanze wrote:
garbage collection.) What you want to do is to "adapt" the Java
API to C++, taking what's good in it, and adapting it to the C++
idiom.
Roland Pibinger wrote:
That's the point. Adapt the Java API to C++ idioms. You can do the
same in C++ with pointers what you can do with references in Java. As
long as you don't try to copy the container the differences are minor.
Of course, in C++ you always have to take ownership into
consideration.
Some years back I worked on a multi-threaded C++ app. I wrote
C++ versions of Java's Thread and Runnable classes for it,
based on a freely-available pthreads library.
It turned out that it was tricky to get the semantics to
match, in part because a C++ reference (type&) is not the same
as a Java reference.
That's because Java's references are really what C++ calls
pointers. Most earlier C++ threading libraries had pretty much
the same interface as the Java one.
Also tricky was to get Thread to be startable on its own or
with a Runnable argument.
What was the problem? It always seems pretty trivial to me.

The big problem in C++ without garbage collection is managing
the lifetime of the thread object of a detached thread. Mainly
because the lifetime is largely irrelevant except for memory
management issues. But there are solutions which work there as
well, and for the most part, if you want to support clean
shutdown, you'll need to use them anyway.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Nov 4 '07 #24
That's what I am finding now!
Thank you very much, and I think it will be very useful.

On Nov 2, 3:53 am, Craig <netburg...@REMOVEgmail.comwrote:
Generic Usenet Account wrote:
Apologies if someone finds this OT
I am looking for an open-source C++ implementation of Java API ----
something that does not require a Java run-time environment ...

Zhang;

Sourceforge.net has a number of C++ implementations. Try the site's
"advanced search."

hth,
-Craig

A couple of hits that may interest you ...

<https://sourceforge.net/projects/j2k/>
"A completely portable C++ library, to provide a standard set of classes
similar to Java Common API. It's highly efficient and it follows the
Embedded C++ Standard. It's FREE (LGPL licensed)."

<https://sourceforge.net/projects/stemkit/>
"A set of C++ libraries and build tools that provide core classes to
build a project upon. From exceptions and basic types (String, Integer,
Float, etc.) to collections and tracers. Where possible, Java API is
followed. Implementation is based on STL."

Nov 5 '07 #25
On Fri, 02 Nov 2007 19:18:01 GMT, Mark Space
<ma*******@sbc.global.netwrote, quoted or indirectly quoted someone
who said :
>
Definitely a good thing, since both projects look like abandon-ware, and
are very incomplete. Too bad, even a partial implementation could have
been useful.
The older you get the more wary you are of relying on any tool that
does not have multiple sources.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Nov 5 '07 #26
On 1 Nov, 19:53, Craig <netburg...@REMOVEgmail.comwrote:
I am looking for an open-source C++ implementation of Java API ----
something that does not require a Java run-time environment ...
Sourceforge.net has a number of C++ implementations. Try the site's
"advanced search."

hth,
-Craig
<https://sourceforge.net/projects/stemkit/>
"A set of C++ libraries and build tools that provide core classes to
build a project upon. From exceptions and basic types (String, Integer,
Float, etc.) to collections and tracers. Where possible, Java API is
followed. Implementation is based on STL."
This one is pre-alpha. There is no web site and no released files. :-(

-Andrew Marlow

Nov 6 '07 #27
ap***@student.open.ac.uk wrote:
On 1 Nov, 19:53, Craig <netburg...@REMOVEgmail.comwrote:
>>I am looking for an open-source C++ implementation of Java API ----
something that does not require a Java run-time environment ...
>Sourceforge.net has a number of C++ implementations. Try the site's
"advanced search."

hth,
-Craig
><https://sourceforge.net/projects/stemkit/>
"A set of C++ libraries and build tools that provide core classes to
build a project upon. From exceptions and basic types (String, Integer,
Float, etc.) to collections and tracers. Where possible, Java API is
followed. Implementation is based on STL."

This one is pre-alpha. There is no web site and no released files. :-(

-Andrew Marlow
Yea;

Sorry Andrew. Looks like a wash. If you find anything let us know though.

thx,
-Craig
Nov 6 '07 #28

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Brown | last post by:
My Java application (a standalone server) consumes 80% CPU right upon startup for no apparent reason. If I do a kill -QUIT on the process all the Java threads are idle. The app uses native JNI...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
14
by: Del Ferguson | last post by:
Group, New to this list. I just found out that FireFox does not display the img alt attribute the same way IE does. I use both browsers to verify that my pages are readable. Dumb me for not...
6
by: malv | last post by:
Multiprocessing has been pushed into the field as the chip manufacturers can no longer deliver as they were used to for many years. The general public has been conditioned to believe that 1 + 1 =...
1
by: Phil Sherman | last post by:
A recent HD failure and next year's first quarter release of Red Hat's EL5 made me decide to temporarily use FC6 on my sandbox system, an IBM Thinkpad T40. UDB 8.1 (FP14) and a UDB 9 Express-C were...
0
by: tejpatil | last post by:
Hi All, This was installed recently on my desktop which has fedora core 6. This used to work perfectly. I used to update linux with daily updates, after few updates this started giving issues. I...
0
by: JosAH | last post by:
Greetings, Introduction At this moment we have a TextProcessor, a LibraryBuilder as well as the Library itself. As you read last week a Library is capable of producing pieces of text in a...
4
by: jith87 | last post by:
What is meant by Core Java?What is meant by Advanced Java?What is the difference between both? Is Core Java useful to connect a JSP front end and MySQL back end?
2
by: shikoh | last post by:
Hello, I really need your help.Well,i have been given this programming project where am supposed to create a core program in java which recieves input from other programs for manupulation.The core...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.