After taking an excursion from Java for almost 10 years, I've recently gone back to using the JDK as part of my learning how to use Scala.
I've totally forgotten how easy it is to use the JDK!
It's really too bad that C++ doesn't have an equivalent resource. IMHO, a great part of the usefulness of Java has nothing to do with garbage collection or not having pointers. Rather, it's the availability of the JDK. Googling around, I wasn't successful in finding any attempts to port the JDK into C++. I do see OpenJDK and the availability of JDK source code from Java.
If I had more time myself, I would attempt to port the libs into C++ using OpenSource (haven't looked into JDK licensing issues).
Has anyone else considered this or found attempts at porting?
* jinfo – (experimental) This utility gets configuration information from a running Java process or crash dump.
Operating system, presumably.
* jmap – (experimental) This utility outputs the memory map for Java and can print shared object memory maps or heap memory details of a given process or core dump.
I don't know of an equivalent tool, other than possibly OS debugging facilities.
* idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file.
Linker?
* policytool – the policy creation and management tool, which can determine policy for a Java runtime, specifying which permissions are available for code from various sources
Operating system, if a permission system is available.
* VisualVM – visual tool integrating several command-line JDK tools and lightweight performance and memory profiling capabilities
System monitor.
* wsimport – generates portable JAX-WS artifacts for invoking a web service.
Some compilers implement pragma directives that let you link libraries directly from the source. The reason this is usually not implemented is (AFAICT) because it's not very useful when used in distributable, portable sources. In Linux, for example, you don't link directly to libsome-1.0.5.4.a. You call a command that returns the proper linker flags (-L/usr/lib -lsome).
It's a solution to an inexistent problem.
I was thinking about using Qt or wxWidgets (last C++ toolkits I've used are XView/Motif/X-Windows) with C++. I have used Ultimate++, which actually has a nice GUI toolkit, but that's a little bit off target from my OP.
As an application developer, having an unified JDK behind me is extremely useful.
When programming in C++, it's usually nice having choices of libs, but most of the time, it would be better to have a standard library behind me that is easy-to-use and just works. I mean sql, socket, threading, and lots of other functionality, etc...
Yes, in C++ there is STL, iostreams, POSIX threads, boost, etc, but it's a mish-mash of libs at all different levels of abstraction. Even a single library like boost is a motley collection of libs.
I am not complaining about C++, only wistfully thinking how nice it would be to have something like a JDK behind C++. It's not even necessary to try to design something better than the JDK - just reverse-engineering it so we have the functionality in C++ would be great.
It doesn't make much sense, the Java libraries are like C++ libraries. The only difference is that JCL comes with all the other tools.
boost is a natural expansion of the standard library and other libraries ( both for C and C++ ) mix quite well with the standard library
It doesn't make much sense, the Java libraries are like C++ libraries.
To a certain extent, but not exactly.
Looking at a very practical stand-point, in general, the time required to get something working in Java takes much less time than doing the same in C++. I am convinced that main reason for this is the ease-of-use of the JCL.
There are other things that are not so nice. For example, I am coding in Scala (using the JCL) under the Netbeans IDE. It's slower because I haven't figured out the vim bindings and compiling is much, much slower than gcc. However, getting things to work on an application-level is much more pleasant, due to the JCL.
I guess my tilt gets me to try languages like D, which does have a JCL-like library in Phobos. Maybe I will have try D/Phobos again, once D 2.0 settles down...
Has anyone else considered this or found attempts at porting?
I thought some of the Java API to C++ but I'm not that experience programmer.
Good for you to have 10 years of programming, it would be nice not to get old while learning a langauge eh.
I think I know what you feel about this. IMO having a rich library that is standard or common is great. I mean like every programmer has the same knowledge when they talk or discuss, C++ world is far away from that world.
BTW please PM me if ever you release some Java API port to C++. I was thinking like wrapping wxWidgets and Boost library and provide a Java like API for C++ programmers :)
PS: what does JCL mean? Quick google search says Job Control Language
Of course, I wouldn't expect a call from C++ to be as seamless as a call from Scala, but at least you wouldn't have to reverse engineer the entire Java platform!
Scala is easy enough to use and the compiles not too slowly, so I think I'll stick with Scala for now.
I meant reverse engineer in the sense of keeping the APIs the same, and the functionality the same, without caring about keeping the implementation the same.
With Java Native Interface you can call Java functions from other languages. It is very cumbersome, but with some practice one can use it without problems.
Java Native Interface is usually not that convenient for use. So far, the only thing I've found it useful for is low-level APIs (OpenGL, DX), and for starting a Java application through an executable (which is rather pointless most of the time). Even then, it's somewhat complex and not really that fun to play with.