Jump to content

Recommended Posts

Posted

I have seen news about that Java isn't open-source.

 

However, under somewhere in javahome dir, I could find a jar called src.

 

When I unzip it, I can see all the classes which are included in the API.

 

Why, yet, Java isn't open source??

 

Albert

Posted

Are you sure these arent just .class (bytecode) files rather than .java (actual text source) files? .class files arent the actual source although im sure they could be decompiled back to some form of src. They are precompiled bytecode (kind of half compiled, ie compiled into something the java virtual machine can interpret/parse easily) rather than actual text sourcecode and are used obviously when you try to include those classes/packages in your application.

 

I know Sun has allowed things like OpenSolaris and I dont know whether they might open a few source files here and there but as far as i know, Java itself and the code that goes along with its architecture is closed source.

 

Apparently they are considering it though, although that could just be a feint to try and buy favour with the open source advocates and community without actually having to do it - Link

Posted
Are you sure these arent just .class (bytecode) files rather than .java (actual text source) files?

 

No, they are the actual source code files. They're in a .zip file on my machine though, not a .jar. As for the question asked, I dunno.. I don't know that much Java.

Posted

Right, that's why you need the little applet running in the background. It takes the Java code and turns it into a program. The advantage of this approach is that the same code works on any platform. Only the background piece changes. (Java programs can also be compiled into standalone applications, and then they don't need the background applet, but they lose their platform independence for that executable.)

 

Java is, I believe, the property of Sun, but they develop it in an "open" way with their "community" approach.

Posted

Pangloss the JVM (Java Virtual Machine) is what you are talking about and it takes the bytecode files (.class) and runs those rather than the actual source code file. The source code file is compiled by the java compiler into byte code when the software developer decides to do so using javac (java compiler).

 

http://en.wikipedia.org/wiki/Java_platform <--- Note there it says bytecode (which if you click on the link will explain that this is not simply the source but a half-compiled, intermediate step)

 

Not sure if you mean byte code or source code but I felt it needed clarification. Sorry if i misunderstood you.

 

 

[EDIT]

Looking in my java folder (on my gentoo desktop (couldnt find the source files on my laptop)), it seems that the .java files in the src.??? (zip in my case) are source files for various classes and packages that you can include when creating java programs. Looking inside alot of them (although i havent had a chance to check them all, nor can i account for anything others might find in different versions), it seems that the classes defined are simply wrapper classes for older versions or something (ie there isnt much code content other than instantiations of / extensions to default java classes (ill show an example of what i mean when im on my desktop for a bit)), which if true for all/most of them means that this might not be open source, but more extensions or compatibility allowances.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.