Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I found that some of the code that Oracle uses is very useful so I don't have to re-invent the wheel.

Given this is at the top of the file where the code in question is:

/*
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.  Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

If I leave the text intact, put it in my C++ header, and credit oracle for each method, and package the source into a static library...is it still a no-no?

share|improve this question
    
I think you'd need to reference the GNU license in question, but I believe you can use the code (with proper attribution). –  Eric Hydrick Jul 8 '12 at 5:02
    

2 Answers 2

If I leave the text intact, put it in my C++ header, and credit oracle for each method, and package the source into a static library...is it still a no-no?

You definitely need to leave the text intact.

For the rest, it is not possible to say without more specifics. In particular, what code you are trying to embed, and how you are doing it. Is it C++ code? Java code? A library module or class? Are you modifying it or including it without modification? Does the "static library" include other code that is not GPL'ed?

But you certainly can reuse the code if you follow the rules to the letter.

share|improve this answer
    
Java code into a C++ program; static library; no modification (beyond what is required to convert it to C++); non-GPL but free (freedom "free", and "free beer" free). –  Casey Jul 8 '12 at 14:59
    
It sounds like what you would be doing would be violating the GPL ... unless you released your derivative work under the GPL. –  Stephen C Jul 20 '12 at 4:24
up vote 1 down vote accepted

After reading the links provided by cpeisert in the comments I have decided that the GPL is too restrictive (weird, right?) for the distribution plan I have for this library. As such, I have removed the GPL'd code and rolled my own solutions.

share|improve this answer
    
Not weird. GPL takes a strong line on using open source code in closed source projects. If you don't like it, don't build your projects out of GPL'ed libraries. –  Stephen C Jul 20 '12 at 4:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.