Skip to content
Advertisement

Using Java Source Code in my own project [closed]

I wrote a program in Java 6.0, but it turns out that some of our client only have 5.0.

The issues is that lot of features that 6.0 has was not in 5.0 yet. For example:

  • JTable Sorting, Filtering feature
  • SwingWorker class

My Question is :

  1. is it legal to just copy the java 6.0 source code to my own project so that my client with 5.0 jre can run it.
  2. from technical point of view, is it hard to copy the classes source code like TableRowSorter, regexFilter to my own project and let it work?

Thanks

Advertisement

Answer

That depends on the source code you are copying from. From JavaSE? OpenJDK?

Wherever you want to copy from, check their license for the code.

The copying may be simple, copying just the classes and it’s dependencies. There may be a lot of specific dependencies though, which can make it consume a lot of time. And you’ll really have a problem when you have to copy a changed class that already existed in version 5, where you would need one version for some code, and the newer for the other. But if you’re only using Java6 code in that project it should be alright. Moving the classes into another package may also be an option, with potentially a lot of work as well though.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement